diff --git a/node_modules/.bin/jsdoc b/node_modules/.bin/jsdoc index 384cdd1..5c04777 120000 --- a/node_modules/.bin/jsdoc +++ b/node_modules/.bin/jsdoc @@ -1 +1 @@ -../jsdoc/nodejs/bin/jsdoc \ No newline at end of file +../jsdoc/jsdoc.js \ No newline at end of file diff --git a/node_modules/getargs/.npmignore b/node_modules/getargs/.npmignore new file mode 100644 index 0000000..30bc162 --- /dev/null +++ b/node_modules/getargs/.npmignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/node_modules/getargs/README.md b/node_modules/getargs/README.md new file mode 100644 index 0000000..3f8e2db --- /dev/null +++ b/node_modules/getargs/README.md @@ -0,0 +1,78 @@ +getargs +======= + +Simple utility for parsing/processing variable length argument lists for Javascript functions; also verifies argument types and argument list length. + +## Install + +Bower - `bower install getargs`; NPM - `npm install getargs`. + +## Usage + + var getArgs = require('getargs') + + function ajax(/* url:string|array, [options]:object, callback:function */){ + var args = getArgs('url:string|array, [options]:object, callback:function', arguments) + + console.log('url is', args.url) + console.log('options is optionally', args.options) + console.log('callback', args.callback) + } + +## Argument Spec Syntax + +The argument spec is a comma delimited string of individual specs, which look like + + argname:type + +You can specify multiple types by using `|` + + argname:type|type|type + +* `argname` is the name of the argument, and can be called anything +* `type` is an optional basic Javascript type. Currently these are supported + * `string` + * `boolean` + * `number` + * `object` + * `function` + * `array` + +### Optional Arguments + +To denote optional arguments, you'd surround `argname` with square brackets `[]`. + +### Type Verification + +getArgs will throw if the arguments have the wrong types + + var args = getArgs('url:string', [1]) + // Error: Expected url(pos 0) to be a string + +### Argument List Length Verification + +getArgs will throw if there are too many or too few arguments + + > getArgs('a,b', [1]) + Error: Not enough arguments, expected 2, got 1 + > getArgs('a,b', [1,1]) + { a: 1, b: 1 } + > getArgs('a,b', [1,1,1]) + Error: Too many arguments, expected 2, got 3 + +### Spread Operator + +You can mimick ES6's spread operator + + var args = getArgs('first,...rest', [1,2,3,4]) + console.log(args.first) // 1 + console.log(args.rest) // [2,3,4] + +### Set properties on an object + +If you pass an object as its third argument, it will set the arguments as properties on that object. + + getArgs('a,b,c', arguments, this) + // Now you can access the arguments by + // this.a, this.b, and this.c + diff --git a/node_modules/getargs/TODO.md b/node_modules/getargs/TODO.md new file mode 100644 index 0000000..a40b089 --- /dev/null +++ b/node_modules/getargs/TODO.md @@ -0,0 +1,6 @@ +TODO +==== + +1. spread operator in the middle. +2. one-character type aliases. +3. wider browser support. \ No newline at end of file diff --git a/node_modules/getargs/example.js b/node_modules/getargs/example.js new file mode 100644 index 0000000..c4b1aaf --- /dev/null +++ b/node_modules/getargs/example.js @@ -0,0 +1,15 @@ +var getArgs = require('./index') + +function ajax(url, opts, callback){ + var args = getArgs( + 'url:string|array,[opts]:object,[callback]:function', + arguments) + console.log(JSON.stringify(args, null, ' ')) +} + +ajax() +ajax('/submit') +ajax(['/submit']) +ajax('/submit', {method: 'POST', params: {foo: 'bar'}}, function(dat){ + +}) diff --git a/node_modules/getargs/index.js b/node_modules/getargs/index.js new file mode 100644 index 0000000..c545595 --- /dev/null +++ b/node_modules/getargs/index.js @@ -0,0 +1,100 @@ +var is = { + 'string': function(s){ return typeof s === 'string' }, + 'function': function(f){ return typeof f === 'function' }, + 'number': function(f){ return typeof f === 'number' }, + 'array': Array.isArray || function(a){ return a instanceof Array }, + 'object': function(o){ return typeof o === 'object' && o != null }, + 'boolean': function(b){ return typeof b === 'boolean' } +} + +function ArgSpec(str){ + var ret + str = str.trim() + var parts = str.split(':') + if (parts.length > 1){ + ret = { + name: parts[0], + type: parts[1].split('|') + } + }else if (parts.length === 1){ + ret = { + name: str + } + }else{ + throw new Error('Expected arg spec to be format name or name:type but was ' + str) + } + var m + if (m = ret.name.match(/^\[(.+)\]$/)){ + ret.name = m[1] + ret.optional = true + } + if (m = ret.name.match(/^\.\.\.(.+)$/)){ + ret.name = m[1] + ret.spread = true + } + return ret +} + +function typeMatches(spec, arg) { + if (!spec.type) return true + + var match = false; + + var type = null; + for (var i = 0; i= args.length){ + if (argIdx < minExpected){ + throw new Error( + 'Not enough arguments, expected ' + + minExpected + ', got ' + argIdx) + } + break + } + if (argIdx >= maxExpected){ + throw new Error('Too many arguments, expected ' + + maxExpected + ', got ' + (argIdx + 1)) + } + var arg = args[argIdx] + if (typeMatches(sp, arg)){ + if (sp.spread){ + ret[sp.name] = Array.prototype.slice.call(args, argIdx) + break + }else{ + ret[sp.name] = arg + } + }else if (sp.optional){ + argIdxOffset-- + }else{ + throw new Error('Expected ' + sp.name + + '(pos ' + i + ') to be a ' + sp.type.join(' or ')) + } + } + return ret +} diff --git a/node_modules/getargs/package.json b/node_modules/getargs/package.json new file mode 100644 index 0000000..ba25fc1 --- /dev/null +++ b/node_modules/getargs/package.json @@ -0,0 +1,50 @@ +{ + "name": "getargs", + "version": "0.0.8", + "description": "Utility to handle optional arguments and argument type checking.", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "chai": "~1.7.2" + }, + "scripts": { + "test": "mocha tests.js -u tdd" + }, + "keywords": [ + "arguments", + "utility" + ], + "repository": { + "type": "git", + "url": "git@github.com:airportyh/getargs.git" + }, + "author": { + "name": "Toby Ho" + }, + "license": "MIT", + "readme": "getargs\n=======\n\nSimple utility for parsing/processing variable length argument lists for Javascript functions; also verifies argument types and argument list length.\n\n## Install\n\nBower - `bower install getargs`; NPM - `npm install getargs`.\n\n## Usage\n\n var getArgs = require('getargs')\n\n function ajax(/* url:string|array, [options]:object, callback:function */){\n var args = getArgs('url:string|array, [options]:object, callback:function', arguments)\n\n console.log('url is', args.url)\n console.log('options is optionally', args.options)\n console.log('callback', args.callback)\n }\n\n## Argument Spec Syntax\n\nThe argument spec is a comma delimited string of individual specs, which look like\n\n argname:type\n\nYou can specify multiple types by using `|`\n\n argname:type|type|type\n\n* `argname` is the name of the argument, and can be called anything\n* `type` is an optional basic Javascript type. Currently these are supported\n * `string`\n * `boolean`\n * `number`\n * `object`\n * `function`\n * `array`\n\n### Optional Arguments\n\nTo denote optional arguments, you'd surround `argname` with square brackets `[]`.\n\n### Type Verification\n\ngetArgs will throw if the arguments have the wrong types\n\n var args = getArgs('url:string', [1])\n // Error: Expected url(pos 0) to be a string\n\n### Argument List Length Verification\n\ngetArgs will throw if there are too many or too few arguments\n\n > getArgs('a,b', [1])\n Error: Not enough arguments, expected 2, got 1\n > getArgs('a,b', [1,1])\n { a: 1, b: 1 }\n > getArgs('a,b', [1,1,1])\n Error: Too many arguments, expected 2, got 3\n\n### Spread Operator\n\nYou can mimick ES6's spread operator\n\n var args = getArgs('first,...rest', [1,2,3,4])\n console.log(args.first) // 1\n console.log(args.rest) // [2,3,4]\n\n### Set properties on an object\n\nIf you pass an object as its third argument, it will set the arguments as properties on that object.\n\n getArgs('a,b,c', arguments, this)\n // Now you can access the arguments by\n // this.a, this.b, and this.c\n \n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/airportyh/getargs/issues" + }, + "_id": "getargs@0.0.8", + "dist": { + "shasum": "8516605872c980178e01ca70106fccd22521fc7c", + "tarball": "http://registry.npmjs.org/getargs/-/getargs-0.0.8.tgz" + }, + "_from": "getargs@*", + "_npmVersion": "1.3.8", + "_npmUser": { + "name": "airportyh", + "email": "airportyh@gmail.com" + }, + "maintainers": [ + { + "name": "airportyh", + "email": "airportyh@gmail.com" + } + ], + "directories": {}, + "_shasum": "8516605872c980178e01ca70106fccd22521fc7c", + "_resolved": "https://registry.npmjs.org/getargs/-/getargs-0.0.8.tgz" +} diff --git a/node_modules/getargs/tests.js b/node_modules/getargs/tests.js new file mode 100644 index 0000000..7293681 --- /dev/null +++ b/node_modules/getargs/tests.js @@ -0,0 +1,96 @@ +var getArgs = require('./index') +var assert = require('chai').assert + +test('basic', function(){ + var args = [1, 2] + var result = getArgs('a,b', args) + assert(result.a === 1) + assert(result.b === 2) + assert.deepEqual(result, getArgs('a, b', args)) +}) + +test('not enough throws', function(){ + getArgs('a', [1]) + assert.throws(function(){ + getArgs('a', []) + }, 'Not enough arguments, expected 1, got 0') +}) + +test('too many throws', function(){ + var args = [1, 2] + assert.throws(function(){ + getArgs('a', args) + }, 'Too many arguments, expected 1, got 2') + assert.throws(function(){ + getArgs('a,b', [1,2,3]) + }, 'Too many arguments, expected 2, got 3') +}) + +test('checks type', function(){ + var result = getArgs('a:string', ['abc']) + assert(result.a === 'abc') + assert.throws(function(){ + getArgs('a:string', [1]) + }, 'Expected a(pos 0) to be a string') + getArgs('a:Array', [[]]) + assert.throws(function(){ + getArgs('a:array', [1]) + }, 'Expected a(pos 0) to be a array') + getArgs('a:number', [3]) + assert.throws(function(){ + getArgs('a:number', ['a']) + }, 'Expected a(pos 0) to be a number') + assert.throws(function(){ + getArgs('a:boolean', ['a']) + }, 'Expected a(pos 0) to be a boolean') +}) + +test('supports multiple types', function(){ + var result = getArgs('a:string|array', ['abc']) + assert.equal(result.a, 'abc') + var result = getArgs('a:string|array', [['abc']]) + assert.deepEqual(result.a, ['abc']) +}) + +test('unknown type', function(){ + assert.throws(function(){ + getArgs('a:blarg', ['abc']) + }, 'Unknown type: blarg') +}) + +test('optional by type', function(){ + var result = getArgs( + '[user]:object,callback:function', + [{name: 'bobby'}, function(){}]) + assert(result.user.name === 'bobby') + result = getArgs( + '[user]:object,callback:function', + [function(){}]) + assert(result.user === undefined) + assert(result.callback instanceof Function) +}) + +test('optional + spread', function(){ + var result = getArgs('[user]:object,...rest',[1,2,3]) + assert.deepEqual(result.rest, [1,2,3]) +}) + +test('optional last', function(){ + var result = getArgs('a,[b]', [1]) + assert(result.a === 1) + assert(result.b === undefined) +}) + +test('spread operator', function(){ + var result = getArgs('a,...b', [1, 2, 3, 4]) + assert(result.b == '2,3,4') +}) + +test('sets properties on target if passed in', function(){ + var target = {} + var args = [1, 2] + getArgs('a,b', args, target) + assert(target.a == 1) + assert(target.b == 2) +}) + diff --git a/node_modules/grunt-jsdoc/node_modules/.bin/jsdoc b/node_modules/grunt-jsdoc/node_modules/.bin/jsdoc deleted file mode 120000 index 5c04777..0000000 --- a/node_modules/grunt-jsdoc/node_modules/.bin/jsdoc +++ /dev/null @@ -1 +0,0 @@ -../jsdoc/jsdoc.js \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/ink-docstrap/node_modules/moment/package.json b/node_modules/grunt-jsdoc/node_modules/ink-docstrap/node_modules/moment/package.json index f7dcf5f..94a3fdf 100644 --- a/node_modules/grunt-jsdoc/node_modules/ink-docstrap/node_modules/moment/package.json +++ b/node_modules/grunt-jsdoc/node_modules/ink-docstrap/node_modules/moment/package.json @@ -114,5 +114,6 @@ ], "directories": {}, "_shasum": "0765b72b841dd213fa91914c0f6765122719f061", - "_resolved": "https://registry.npmjs.org/moment/-/moment-2.6.0.tgz" + "_resolved": "https://registry.npmjs.org/moment/-/moment-2.6.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/ink-docstrap/package.json b/node_modules/grunt-jsdoc/node_modules/ink-docstrap/package.json index 8c536e7..81b4032 100755 --- a/node_modules/grunt-jsdoc/node_modules/ink-docstrap/package.json +++ b/node_modules/grunt-jsdoc/node_modules/ink-docstrap/package.json @@ -58,5 +58,7 @@ ], "directories": {}, "_shasum": "d41e376919debdad061288c11c8022b785e8acdf", - "_resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-0.4.12.tgz" + "_resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-0.4.12.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/terryweiss/docstrap" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/.npmignore b/node_modules/grunt-jsdoc/node_modules/jsdoc/.npmignore deleted file mode 100644 index aaa8ad0..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -# development-related files -.eslintignore -.eslintrc -.gitignore -.travis.yml -gulpfile.js - -# scripts for launching JSDoc with Mozilla Rhino -/jsdoc* -!/jsdoc.js - -# Rhino and test directories -rhino/ -test/ diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/Apache_License_2.0.txt b/node_modules/grunt-jsdoc/node_modules/jsdoc/Apache_License_2.0.txt deleted file mode 100644 index d645695..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/Apache_License_2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/CONTRIBUTING.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/CONTRIBUTING.md deleted file mode 100644 index 2ed1942..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/CONTRIBUTING.md +++ /dev/null @@ -1,69 +0,0 @@ -Pull Requests -------------- - -If you're thinking about making some changes, maybe fixing a bug, or adding a -snazzy new feature, first, thank you. Contributions are very welcome. Things -need to be manageable for the maintainers, however. So below you'll find **The -fastest way to get your pull request merged in.** Some things, particularly how -you set up your branches and work with git, are just suggestions, but pretty good -ones. - -1. **Create a remote to track the base jsdoc3/jsdoc repository** - This is just a convenience to make it easier to update your `````` - (more on that shortly). You would execute something like: - - git remote add base git://github.com/jsdoc3/jsdoc.git - - Here 'base' is the name of the remote. Feel free to use whatever you want. - -2. **Set up a tracking branch for the base repository** - We're gonna call this your ``````. You will only ever update - this branch by pulling from the 'base' remote. (as opposed to 'origin') - - git branch --track pullpost base/master - git checkout pullpost - - Here 'pullpost' is the name of the branch. Fell free to use whatever you want. - -3. **Create your change branch** - Once you are in ``````, make sure it's up to date, then create - a branch for your changes off of that one. - - git branch fix-for-issue-395 - git checkout fix-for-issue-395 - - Here 'fix-for-issue-395' is the name of the branch. Feel free to use whatever - you want. We'll call this the ``````. This is the branch that - you will eventually issue your pull request from. - - The purpose of these first three steps is to make sure that your merge request - has a nice clean diff that only involves the changes related to your fix/feature. - -4. **Make your changes** - On your `````` make any changes relevant to your fix/feature. Don't - group fixes for multiple unrelated issues or multiple unrelated features together. - Create a separate branch for each unrelated changeset. For instance, if you're - fixing a bug in the parser and adding some new UI to the default template, those - should be separate branches and merge requests. - -5. **Add tests** - Add tests for your change. If you are submitting a bugfix, include a test that - verifies the existence of the bug along with your fix. If you are submitting - a new feature, include tests that verify proper feature function, if applicable. - See the readme in the 'test' directory for more information - -6. **Commit and publish** - Commit your changes and publish your branch (or push it if it's already published) - -7. **Issue your pull request** - On github.com, switch to your `````` and click the 'Pull Request' - button. Enter some meaningful information about the pull request. If it's a bugfix, - that doesn't already have an issue associated with it, provide some info on what - situations that bug occurs in and a sense of it's severity. If it does already have - an issue, make sure the include the hash and issue number (e.g. '#100') so github - links it. - - If it's a feature, provide some context about the motivations behind the feature, - why it's important/useful/cool/necessary and what it does/how it works. Don't - worry about being too verbose. Folks will be much more amenable to reading through - your code if they know what its supposed to be about. diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/LICENSE.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/LICENSE.md deleted file mode 100644 index 051763a..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/LICENSE.md +++ /dev/null @@ -1,391 +0,0 @@ -# License # - -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 -[contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). -All rights reserved. - -You may obtain a copy of the License at: -http://www.apache.org/licenses/LICENSE-2.0 - -In addition, a copy of the License is included with this distribution. - -As stated in Section 7, "Disclaimer of Warranty," of the License: - -> Licensor provides the Work (and each Contributor provides its Contributions) -> on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -> express or implied, including, without limitation, any warranties or -> conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -> PARTICULAR PURPOSE. You are solely responsible for determining the -> appropriateness of using or redistributing the Work and assume any risks -> associated with Your exercise of permissions under this License. - -The source code for JSDoc 3 is available at: -https://github.com/jsdoc3/jsdoc - -# Third-Party Software # - -JSDoc 3 includes or depends upon the following third-party software, either in -whole or in part. Each third-party software package is provided under its own -license. - -## MIT License ## - -Several of the following software packages are distributed under the MIT -license, which is reproduced below: - -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - -## Acorn ## - -Portions of the Acorn source code are incorporated into the following files: - -- `lib/jsdoc/src/walker.js` - -Acorn is distributed under the MIT license, which is reproduced above. - -Copyright (C) 2012 Marijn Haverbeke . - -The source code for Acorn is available at: -https://github.com/marijnh/acorn - -## Async.js ## - -Async.js is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2010 Caolan McMahon. - -The source code for Async.js is available at: -https://github.com/caolan/async - -## Catharsis ## - -Catharsis is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2012-2013 Jeff Williams. - -The source code for Catharsis is available at: -https://github.com/hegemonic/catharsis - -## crypto-browserify ## - -crypto-browserify is distributed under the MIT license, which is reproduced -above. - -Copyright (c) 2013 Dominic Tarr. - -The source code for crypto-browserify is available at: -https://github.com/dominictarr/crypto-browserify - -## Esprima ## - -Esprima is distributed under the BSD 2-clause license: - -> Redistribution and use in source and binary forms, with or without -> modification, are permitted provided that the following conditions are met: -> -> - Redistributions of source code must retain the above copyright notice, -> this list of conditions and the following disclaimer. -> - Redistributions in binary form must reproduce the above copyright notice, -> this list of conditions and the following disclaimer in the documentation -> and/or other materials provided with the distribution. -> -> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -> ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -> DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -> ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -> THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Copyright (c) 2011-2013 Ariya Hidayat and other Esprima contributors. - -The source code for Esprima is available at: -https://github.com/ariya/esprima - -## github-flavored-markdown ## - -github-flavored-markdown is distributed under the BSD 3-clause license: - -> Copyright (c) 2007, John Fraser All rights -> reserved. -> -> Original Markdown copyright (c) 2004, John Gruber -> All rights reserved. -> -> Redistribution and use in source and binary forms, with or without -> modification, are permitted provided that the following conditions are met: -> -> - Redistributions of source code must retain the above copyright notice, -> this list of conditions and the following disclaimer. -> -> - Redistributions in binary form must reproduce the above copyright notice, -> this list of conditions and the following disclaimer in the documentation -> and/or other materials provided with the distribution. - -> - Neither the name "Markdown" nor the names of its contributors may be used -> to endorse or promote products derived from this software without specific -> prior written permission. -> -> This software is provided by the copyright holders and contributors "as is" -> and any express or implied warranties, including, but not limited to, the -> implied warranties of merchantability and fitness for a particular purpose are -> disclaimed. In no event shall the copyright owner or contributors be liable -> for any direct, indirect, incidental, special, exemplary, or consequential -> damages (including, but not limited to, procurement of substitute goods or -> services; loss of use, data, or profits; or business interruption) however -> caused and on any theory of liability, whether in contract, strict liability, -> or tort (including negligence or otherwise) arising in any way out of the use -> of this software, even if advised of the possibility of such damage. - -The source code for github-flavored-markdown is available at: -https://github.com/hegemonic/github-flavored-markdown - -## Google Code Prettify ## - -Google Code Prettify is distributed under the Apache License 2.0, which is -included with this package. - -Copyright (c) 2006 Google Inc. - -The source code for Google Code Prettify is available at: -https://code.google.com/p/google-code-prettify/ - -## Jasmine ## - -Jasmine is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2008-2011 Pivotal Labs. - -The source code for Jasmine is available at: -https://github.com/pivotal/jasmine - -## jasmine-node ## - -jasmine-node is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2010 Adam Abrons and Misko Hevery (http://getangular.com). - -The source code for jasmine-node is available at: -https://github.com/mhevery/jasmine-node - -## js2xmlparser ## - -js2xmlparser is distributed under the MIT license, which is reproduced above. - -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: - -- `rhino/fs.js` -- `rhino/path.js` -- `rhino/querystring.js` -- `rhino/util.js` - -Node.js is distributed under the MIT license, which is reproduced above. - -Copyright Joyent, Inc. and other Node contributors. All rights reserved. - -The source code for Node.js is available at: -https://github.com/joyent/node - -## node-browser-builtins ## - -Portions of the node-browser-builtins source code are incorporated into the -following files: - -- `rhino/assert.js` -- `rhino/rhino-shim.js` - -node-browser-builtins is distributed under the MIT license, which is reproduced -above. - -The source code for node-browser-builtins is available at: -https://github.com/alexgorbatchev/node-browser-builtins - -## node-browserify ## - -Portions of the node-browserify source code are incorporated into the following -files: - -- `rhino/events.js` - -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 - -## Requizzle ## - -Requizzle is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2014 Google Inc. All rights reserved. -Copyright (c) 2012-2013 Johannes Ewald. - -The source code for Requizzle is available at: -https://github.com/hegemonic/requizzle - -## Rhino ## - -Rhino is distributed under the following licenses: - -### MPL 2.0 License ### -The majority of the source code for Rhino is available under the Mozilla Public -License (MPL) 2.0, which is included in this distribution. - -### License for portions of the Rhino debugger ### -Additionally, some files are available under the BSD 3-clause license: - -> Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved. -> -> Redistribution and use in source and binary forms, with or without -> modification, are permitted provided that the following conditions are met: -> -> - Redistributions of source code must retain the above copyright notice, -> this list of conditions and the following disclaimer. -> - Redistributions in binary form must reproduce the above copyright -> notice, this list of conditions and the following disclaimer in the -> documentation and/or other materials provided with the distribution. -> - Neither the name of Sun Microsystems nor the names of its contributors -> may be used to endorse or promote products derived from this software -> without specific prior written permission. -> -> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -### Source Code ### -The source code for Rhino is available at: -https://github.com/jsdoc3/rhino - -## TaffyDB ## - -TaffyDB is distributed under a modified BSD license: - -> All rights reserved. -> -> Redistribution and use of this software in source and binary forms, with or -> without modification, are permitted provided that the following condition is -> met: -> -> Redistributions of source code must retain the above copyright notice, this -> list of conditions and the following disclaimer. -> -> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -> POSSIBILITY OF SUCH DAMAGE. - -The source code for TaffyDB is available at: -https://github.com/hegemonic/taffydb - -## Tomorrow Theme for Google Code Prettify ## - -License information for the Tomorrow Theme for Google Code Prettify is not -available. It is assumed that the package is distributed under an open source -license that is compatible with the Apache License 2.0. - -Copyright (c) Yoshihide Jimbo. - -The source code for the Tomorrow Theme is available at: -https://github.com/jmblog/color-themes-for-google-code-prettify - -## tv4 ## - -tv4 is in the public domain. It is also distributed under the MIT license, which -is reproduced above. - -The source code for tv4 is available at: -https://github.com/geraintluff/tv4 - -## Underscore.js ## - -Underscore.js is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative -Reporters & Editors. - -The source code for Underscore.js is available at: -https://github.com/jashkenas/underscore - -## wrench-js ## - -wrench-js is distributed under the MIT license, which is reproduced above. - -Copyright (c) 2010 Ryan McGrath. - -The source code for wrench-js is available at: -https://github.com/ryanmcgrath/wrench-js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/README.md deleted file mode 100644 index bae6441..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/README.md +++ /dev/null @@ -1,132 +0,0 @@ -JSDoc 3 -======= -[![Build Status](https://img.shields.io/travis/jsdoc3/jsdoc.svg)](http://travis-ci.org/jsdoc3/jsdoc) - -An API documentation generator for JavaScript. - -Want to contribute to JSDoc? Please read `CONTRIBUTING.md`. - -Installation and Usage ----------------------- - -You can run JSDoc on either Node.js or Mozilla Rhino. - -### Node.js - -Native support for Node.js is available in JSDoc 3.3.0 and later. JSDoc -supports Node.js 0.10 and later. - -#### Installing JSDoc for Node.js - -You can install JSDoc in your project's `node_modules` folder, or you can -install it globally. - -To install the latest alpha version: - - npm install jsdoc@"<=3.3.0" - -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 -`./node_modules/.bin`. To generate documentation for the file -`yourJavaScriptFile.js`: - - ./node_modules/.bin/jsdoc yourJavaScriptFile.js - -Or if you installed JSDoc globally, simply run the `jsdoc` command: - - jsdoc yourJavaScriptFile.js - -By default, the generated documentation is saved in a directory named `out`. You -can use the `--destination` (`-d`) option to specify another directory. - -Run `jsdoc --help` for a complete list of command-line options. - -### Mozilla Rhino - -All versions of JSDoc 3 run on a customized version of Mozilla Rhino, which -requires Java. You can run JSDoc 3 on Java 1.6 and later. - -#### Installing JSDoc for Mozilla Rhino - -To install JSDoc, download a .zip file for the -[latest development version](https://github.com/jsdoc3/jsdoc/archive/master.zip) -or a [previous release](https://github.com/jsdoc3/jsdoc/tags). - -You can also use git to clone the -[JSDoc repository](https://github.com/jsdoc3/jsdoc): - - git clone git+https://github.com/jsdoc3/jsdoc.git - -The JSDoc repository includes a -[customized version of Mozilla Rhino](https://github.com/jsdoc3/rhino). Make -sure your Java classpath does not include any other versions of Rhino. (On OS X, -you may need to remove the file `~/Library/Java/Extensions/js.jar`.) - -**Note**: In JSDoc 3.3.0 and later, if you need to run JSDoc on Mozilla Rhino, -do not install JSDoc with npm. Use one of the methods described above. - -#### Running JSDoc with Mozilla Rhino - -On OS X, Linux, and other POSIX systems, to generate documentation for the file -`yourJavaScriptFile.js`: - - ./jsdoc yourJavaScriptFile.js - -Or on Windows: - - jsdoc yourJavaScriptFile.js - -By default, the generated documentation is saved in a directory named `out`. You -can use the `--destination` (`-d`) option to specify another directory. - -Run `jsdoc --help` for a complete list of command-line options. - - -Templates and Build Tools -------------------------- - -The JSDoc community has created numerous templates and other tools to help you -generate and customize your documentation. Here are just a few: - -### Templates - -+ [jaguarjs-jsdoc](https://github.com/davidshimjs/jaguarjs-jsdoc) - ([example](http://davidshimjs.github.io/jaguarjs/doc)) -+ [DocStrap](https://github.com/terryweiss/docstrap) -+ [jsdoc3Template](https://github.com/DBCDK/jsdoc3Template) - ([example](https://github.com/danyg/jsdoc3Template/wiki#wiki-screenshots)) - -### Build Tools - -+ [JSDoc Grunt plugin](https://github.com/krampstudio/grunt-jsdoc) -+ [JSDoc ant task](https://github.com/jannon/jsdoc3-ant-task) - - -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) -+ Post questions tagged `jsdoc` to [Stack -Overflow](http://stackoverflow.com/questions/tagged/jsdoc). - -License -------- - -JSDoc 3 is copyright (c) 2011-2014 Michael Mathews and the -[contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). - -JSDoc 3 is free software, licensed under the Apache License, Version 2.0. See -the file `LICENSE.md` in this distribution for more details. diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/changes.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/changes.md deleted file mode 100644 index fc832d8..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/changes.md +++ /dev/null @@ -1,240 +0,0 @@ -# JSDoc 3 change history - -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.2.2 (November 2013) - -### Bug fixes -+ Addressed a regression in JSDoc 3.2.1 that could prevent a function declaration from shadowing a declaration with the same name in an outer scope. (#513) -+ If a child class overrides a method in a parent class without documenting the overridden method, the method's documentation is now copied from the parent class. (#503) -+ You can now use inline HTML tags in Markdown-formatted text. In addition, JSDoc now uses only the [marked Markdown parser](https://github.com/chjj/marked); the markdown-js parser has been removed. (#510) -+ Type expressions can now include a much broader range of repeatable types. In addition, you can now use Closure Compiler's nullable and non-nullable modifiers with repeatable types. For example, the type expression `...!string` (a repeatable, non-nullable string) is now parsed correctly. (#502) -+ 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 -+ JSDoc's parser now fires a `processingComplete` event after JSDoc has completed all post-processing of the parse results. This event has a `doclets` property containing an array of doclets. (#421) -+ When JSDoc's parser fires a `parseComplete` event, the event now includes a `doclets` property containing an array of doclets. (#431) -+ You can now use relative paths in the JSDoc configuration file's `source.exclude` option. Relative paths will be resolved relative to the current working directory. (#405) -+ If a symbol uses the `@default` tag, and its default value is an object literal, this value is now stored as a string, and the doclet will have a `defaultvaluetype` property containing the string `object`. This change enables templates to show the default value with appropriate syntax highlighting. (#419) -+ Inline `{@link}` tags can now contain newlines. (#441) - -### Bug fixes -+ Inherited symbols now indicate that they were inherited from the ancestor that defined the symbol, rather than the direct parent. (#422) -+ If the first line of a JavaScript file contains a hashbang (for example, `#!/usr/bin/env node`), the hashbang is now ignored when the file is parsed. (#499) -+ Resolved a crash when a JavaScript file contains a [JavaScript 1.8](https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.8) keyword, such as `let`. (#477) -+ The type expression `function[]` is now parsed correctly. (#493) -+ If a module is tagged incorrectly, the module's output file now has a valid filename. (#440, #458) -+ For tags that accept names, such as `@module` and `@param`, if a hyphen is used to separate the name and description, the hyphen must appear on the same line as the name. This change prevents a Markdown bullet on the followng line from being interpreted as a separator. (#459) -+ When lenient mode is enabled, a `@param` tag with an invalid type expression no longer causes a crash. (#448) -+ The `@requires` tag can now contain an inline tag in its tag text. (#486) -+ The `@returns` tag can now contain inline tags even if a type is not specified. (#444) -+ When lenient mode is enabled, a `@returns` tag with no value no longer causes a crash. (#451) -+ The `@type` tag now works correctly with type expressions that span multiple lines. (#427) -+ If a string contains inline `{@link}` tags preceded by bracketed link text (for example, `[test]{@link Test#test}`), HTML links are now generated correctly even if the string contains other bracketed text. (#470) -+ On POSIX systems, if you run JSDoc using a symlink to the startup script, JSDoc now works correctly. (#492) - -### Default template -+ Pretty-printed source files are now generated by default. To disable this feature, add the property `templates.default.outputSourceFiles: false` to your `conf.json` file. (#454) -+ Links to a specific line in a source file now work correctly. (#475) -+ Pretty-printed source files are now generated using the encoding specified in the `-e/--encoding` option. (#496) -+ 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 -+ JSDoc can now parse any valid [Google Closure Compiler type expression](https://developers.google.com/closure/compiler/docs/js-for-compiler#types). **Note**: As a result of this change, JSDoc quits if a file contains an invalid type expression. To prevent JSDoc from quitting, run JSDoc with the `--lenient` (`-l`) command-line option. (Multiple issues) -+ You can now use the new `@listens` tag to indicate that a symbol listens for an event. (#273) - -### Enhancements -+ The parser now fires a `parseBegin` event before it starts parsing files, as well as a `parseComplete` event after all files have been parsed. Plugins can define event handlers for these events, and `parseBegin` handlers can modify the list of files to parse. (#299) -+ Event handlers for `jsdocCommentFound` events can now modify the JSDoc comment. (#228) -+ You can now exclude tags from Markdown processing using the new option `markdown.excludeTags` in the configuration file. (#337) -+ You can now use the [marked](https://github.com/chjj/marked) Markdown parser by setting the configuration property `markdown.parser` to `marked`. In addition, if `markdown.parser` is set to `gfm`, JSDoc will now use the "marked" parser instead. (#385) -+ The `@typedef` tag no longer requires a name when used with a Closure Compiler-style type definition. For example, the following type definition will automatically get the name `Foo.Bar`: - - ```javascript - /** @typedef {string} */ - Foo.Bar; - ``` - - (#391) -+ You can now use an inline `{@type}` tag in a parameter's description. If this tag is present, JSDoc will assume that the parameter uses the type specified in the inline `{@type}` tag. For example, the following `@param` tag would cause `myParam`'s type to be documented as `Foo`: - - ``` - @param {(boolean|string)} myParam - My special parameter. {@type Foo} - ``` - - (#152) -+ The `console.log` function now behaves the same way as on Node.js. In addition, the functions `console.info`, `console.error`, `console.warn`, and `console.trace` have been implemented. (#298) -+ You can now use npm to install JSDoc globally by running `npm install -g`. **Note**: JSDoc will still run under Mozilla Rhino, not Node.js. (#374) -+ The `jsVersion` configuration property has been removed. (#390) - -### Bug fixes -+ JSDoc now quits if the configuration file cannot be loaded. (#407) -+ JSDoc's `--explain` (`-X`) option now runs much more quickly, and it outputs valid JSON to the console. (#298) -+ JSDoc's `--lenient` (`-l`) option now prints warnings on STDERR rather than STDOUT. (#298) -+ The parser now assigns the correct scope to object properties whose names include single quotes. (#386) -+ The parser now recognizes CommonJS modules that export a single function rather than an object. (#384) -+ The inline `{@link}` tag now works correctly when `@link` is followed by a tab. (#359) -+ On POSIX systems, quoted command-line arguments are no longer split on spaces. (#397) - -### Plugins -+ The new `overloadHelper` plugin makes it easier to link to overloaded methods. (#179) -+ The `markdown` plugin now converts Markdown links in the `@see` tag. (#297) - -### Default template enhancements -+ You can now use the configuration property `templates.default.staticFiles` to copy additional static files to the output directory. (#393) -+ All output files now use human-readable filenames. (#339) -+ The documentation for events now lists the symbols that listen to that event. (#273) -+ Links to source files now allow you to jump to the line where a symbol is defined. (#316) -+ The output files now link to individual types within a Closure Compiler type expression. (Multiple issues) -+ CommonJS modules that export a single function, rather than an object, are now documented more clearly. (#384) -+ Functions that can throw multiple types of errors are now documented more clearly. (#389) -+ If a `@property` tag does not identify the property's name, the template no longer throws an error. (#373) -+ The type of each `@typedef` is now displayed. (#391) -+ If a `@see` tag contains a URL (for example, `@see http://example.com` or `@see `), the tag text is now converted to a link. (#371) -+ Repeatable parameters are now identified. (#381) -+ 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) -+ Resolved a crash when JSDoc cannot identify the common prefix of several paths. (#330) -+ Resolved a crash when the full path to JSDoc contained at least one space. (#347) -+ Files named `README.md` or `package.json` will now be processed when they are specified on the command line. (#350) -+ You can now use `@emits` as a synonym for `@fires`. (#324) -+ The module `jsdoc/util/templateHelper` now allows you to specify the CSS class for links that are generated by the following methods: (#331) - + `getAncestorLinks` - + `getSignatureReturns` - + `getSignatureTypes` - + `linkto` - -## 3.1.0 (January 2013) - -### Major changes -+ You can now use the new `@callback` tag to provide information about a callback function's signature. To document a callback function, create a standalone JSDoc comment, as shown in the following example: - - ```javascript - /** - * @class - */ - function MyClass() {} - - /** - * Send a request. - * - * @param {MyClass~responseCb} cb - Called after a response is received. - */ - MyClass.prototype.sendRequest = function(cb) { - // code - }; - - /** - * Callback for sending a request. - * - * @callback MyClass~responseCb - * @param {?string} error - Information about the error. - * @param {?string} response - Body of the response. - */ - ``` -+ The inline link tag, `{@link}`, has been improved: - + You can now use a space as the delimiter between the link target and link text. - + In your `conf.json` file, you can now enable the option `templates.cleverLinks` to display code links in a monospace font and URL links in plain text. You can also enable the option `templates.monospaceLinks` to display all links in a monospace font. **Note**: JSDoc templates must be updated to respect these options. - + You can now use the new inline tags `{@linkplain}`, which forces a plain-text link, and `{@linkcode}`, which forces a monospace link. These tags always override the settings in your `conf.json` file. (#250) -+ JSDoc now provides a `-l/--lenient` option that tells JSDoc to continue running if it encounters a non-fatal error. (Multiple issues) -+ A template's `publish.js` file should now assign its `publish` function to `exports.publish`, rather than defining a global `publish` function. The global `publish` function is deprecated and may not be supported in future versions. JSDoc's built-in templates reflect this change. (#166) -+ The template helper (`templateHelper.js`) exports a variety of new functions for finding information within a parse tree. These functions were previously contained within the default template. (#186) -+ Updated the `fs` and `path` modules to make their behavior more consistent with Node.js. In addition, created extended versions of these modules with additional functionality. (Multiple commits) -+ Updated or replaced numerous third-party modules. (Multiple commits) -+ Reorganized the JSDoc codebase in preparation for future enhancements. (Multiple commits) -+ JSDoc now embeds a version of Mozilla Rhino that recognizes Node.js packages, including `package.json` files. (Multiple commits) -+ Node.js' `npm` utility can now install JSDoc from its GitHub repository. **Note**: JSDoc is not currently compatible with Node.js. However, this change allows JSDoc to be installed as a dependency of a Node.js project. In this version, global installation with `npm` is not supported. (Multiple commits) - -### Enhancements -+ If a `README.md` file is passed to JSDoc, its contents will be included on the `index.html` page of the generated documentation. (#128) -+ The `@augments` tag can now refer to an undocumented member, such as `window.XMLHTTPRequest`. (#160) -+ The `@extends` tag can now refer to an undocumented member, such as `window.XMLHttpRequest`. In addition, you can now use `@host` as a synonym for `@extends`. (#145) -+ The `@lends` tag is now supported in multiline JSDoc comments. (#163) -+ On Windows, `jsdoc.cmd` now provides the same options as the `jsdoc` shell script. (#127) -+ JSDoc now provides `setTimeout()`, `clearTimeout()`, `setInterval()`, and `clearInterval()` functions. (Multiple commits) -+ JSDoc no longer provides a global `exit()` function. Use `process.exit()` instead. (1228a8f7) -+ JSDoc now includes additional shims for Node.js' built-in modules. **Note**: Many of these shims implement only the functions that JSDoc uses, and they may not be consistent with Node.js' behavior in edge cases. (Multiple commits) -+ JSDoc now provides a `-v/--version` option to display information about the current version. (#303) -+ When running tests, you can now use the `--nocolor` option to disable colored output. On Windows, colored output is always disabled. (e17601fe, 8bc33541) - -### Bug fixes -+ When using the `@event` tag to define an event within a class or namespace, the event's longname is now set correctly regardless of tag order. (#280) -+ The `@property` tag no longer results in malformed parse trees. (20f87094) -+ The `jsdoc` and `jsdoc.cmd` scripts now work correctly with paths that include spaces. (#127, #130) -+ The `jsdoc` script now works correctly on Cygwin and MinGW, and with the `dash` shell. (#182, #184, #187) -+ The `-d/--destination` option is no longer treated as a path relative to the JSDoc directory. Instead, it can contain an absolute path, or a path relative to the current working directory. (f5e3f0f3) -+ JSDoc now provides default options for the values in `conf.json`. (#129) -+ If the `conf.json` file does not exist, JSDoc no longer tries to create it, which prevents errors if the current user does not have write access to the JSDoc directory. (d2d05fcb) -+ Doclets for getters and setters are now parsed appropriately. (#150) -+ Only the first asterisk is removed from each line of a JSDoc comment. (#172) -+ If a child member overrides an ancestor member, the ancestor member is no longer documented. (#158) -+ If a member of a namespace has the same name as a namespace, the member is now documented correctly. (#214) -+ The parse tree now uses a single set of properties to track both JSDoc-style type information and Closure Compiler-style type information. (#118) -+ If a type has a leading `!`, indicating that it is non-nullable, the leading `!` is now removed from the type name. (#226) -+ When Markdown formatting is enabled, underscores in inline `{@link}` tags are no longer treated as Markdown formatting characters. (#259) -+ Markdown links now work correctly when a JavaScript reserved word, such as `constructor`, is used as the link text. (#249) -+ Markdown files for tutorials are now parsed based on the settings in `conf.json`, rather than using the "evilstreak" Markdown parser in all cases. (#220) -+ If a folder contains both tutorial source files and `.js` files, JSDoc no longer attempts to parse the `.js` files as JSON files. (#222) -+ The "evilstreak" Markdown parser now works correctly with files that use Windows-style line endings. (#223) -+ JSDoc no longer fails unit tests when the `conf.json` file is not present. (#206) -+ On Windows, JSDoc now passes all unit tests. (Multiple commits) - -### Plugins -+ The new `partial` plugin adds support for a `@partial` tag, which links to an external file that contains JSDoc comments. (#156) -+ The new `commentsOnly` plugin removes everything in a file except JSDoc-style comments. You can use this plugin to document source files that are not valid JavaScript, including source files for other languages. (#304) -+ The new `eventDumper` plugin logs information about parser events to the console. (#242) -+ The new `verbose` plugin logs the name of each input file to the console. (#157) - -### Template enhancements - -#### Default template -+ The template output now includes pretty-printed versions of source files. This feature is enabled by default. To disable this feature, add the property `templates.default.outputSourceFiles: false` to your `conf.json` file. (#208) -+ You can now use the template if it is placed outside of the JSDoc directory. (#198) -+ The template no longer throws an error when a parameter does not have a name. (#175) -+ The navigation bar now includes an "Events" section if any events are documented. (#280) -+ Pages no longer include a "Classes" header when no classes are documented. (eb0186b9) -+ Member details now include "Inherited From" section when a member is inherited from another member. (#154) -+ If an `@author` tag contains text in the format "Jane Doe ", the value is now converted to an HTML `mailto:` link. (#326) -+ Headings for functions now include the function's signature. (#253) -+ Type information is now displayed for events. (#192) -+ Functions now link to their return type when appropriate. (#192) -+ Type definitions that contain functions are now displayed correctly. (#292) -+ Tutorial output is now generated correctly. (#188) -+ Output files now use Google Code Prettify with the Tomorrow theme as a syntax highlighter. (#193) -+ The `index.html` output file is no longer overwritten if a namespace called `index` has been documented. (#244) -+ The current JSDoc version number is now displayed in the footer. (#321) - -#### Haruki template -+ 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 -+ The `conf.json` file may now contain `source.include` and `source.exclude` properties. (#56) - + `source.include` specifies files or directories that JSDoc should _always_ check for documentation. - + `source.exclude` specifies files or directories that JSDoc should _never_ check for documentation. - These settings take precedence over the `source.includePattern` and `source.excludePattern` properties, which contain regular expressions that JSDoc uses to search for source files. -+ The `-t/--template` option may now specify the absolute path to a template. (#122) - -### Bug fixes -+ JSDoc no longer throws exceptions when a symbol has a special name, such as `hasOwnProperty`. (1ef37251) -+ The `@alias` tag now works correctly when documenting inner classes as globals. (810dd7f7) - -### Template improvements -+ 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/grunt-jsdoc/node_modules/jsdoc/conf.json.EXAMPLE b/node_modules/grunt-jsdoc/node_modules/jsdoc/conf.json.EXAMPLE deleted file mode 100644 index 12bff5b..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/conf.json.EXAMPLE +++ /dev/null @@ -1,17 +0,0 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "source": { - "includePattern": ".+\\.js(doc)?$", - "excludePattern": "(^|\\/|\\\\)_" - }, - "plugins": [], - "templates": { - "cleverLinks": false, - "monospaceLinks": false, - "default": { - "outputSourceFiles": true - } - } -} \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc.js deleted file mode 100755 index 5ea476d..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/jsdoc.js +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env node -/*global arguments, require: true */ -/** - * @project jsdoc - * @author Michael Mathews - * @license See LICENSE.md file included in this distribution. - */ - -/** - * Data representing the environment in which this app is running. - * - * @namespace - * @name env - */ -global.env = { - /** - * Running start and finish times. - * - * @memberof env - */ - run: { - start: new Date(), - finish: null - }, - - /** - * The command-line arguments passed into JSDoc. - * - * @type Array - * @memberof env - */ - args: [], - - /** - * The parsed JSON data from the configuration file. - * - * @type Object - * @memberof env - */ - conf: {}, - - /** - * The absolute path to the base directory of the JSDoc application. - * - * @private - * @type string - * @memberof env - */ - dirname: '.', - - /** - * The user's working directory at the time that JSDoc was started. - * - * @private - * @type string - * @memberof env - */ - pwd: null, - - /** - * The command-line options, parsed into a key/value hash. - * - * @type Object - * @memberof env - * @example if (global.env.opts.help) { console.log('Helpful message.'); } - */ - opts: {}, - - /** - * The source files that JSDoc will parse. - * @type Array - * @memberof env - */ - sourceFiles: [], - - /** - * The JSDoc version number and revision date. - * - * @type Object - * @memberof env - */ - version: {} -}; - -// initialize the environment for the current JavaScript VM -(function(args) { - 'use strict'; - - var path; - - if (args[0] && typeof args[0] === 'object') { - // we should be on Node.js - args = [__dirname, process.cwd()]; - path = require('path'); - - // Create a custom require method that adds `lib/jsdoc` and `node_modules` to the module - // lookup path. This makes it possible to `require('jsdoc/foo')` from external templates and - // plugins, and within JSDoc itself. It also allows external templates and plugins to - // require JSDoc's module dependencies without installing them locally. - require = require('requizzle')({ - requirePaths: { - before: [path.join(__dirname, 'lib')], - after: [path.join(__dirname, 'node_modules')] - }, - infect: true - }); - } - - require('./lib/jsdoc/util/runtime').initialize(args); -})( Array.prototype.slice.call(arguments, 0) ); - -/** - * Data that must be shared across the entire application. - * - * @namespace - * @name app - */ -global.app = { - jsdoc: { - name: require('./lib/jsdoc/name'), - parser: null, - scanner: new (require('./lib/jsdoc/src/scanner').Scanner)() - } -}; - -/** - * Recursively print an object's properties to stdout. This method is safe to use with objects that - * contain circular references. In addition, on Mozilla Rhino, this method is safe to use with - * native Java objects. - * - * @global - * @name dump - * @private - * @param {Object} obj - Object(s) to print to stdout. - */ -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])) ); - } -}; - -(function() { - 'use strict'; - - var logger = require('./lib/jsdoc/util/logger'); - var runtime = require('./lib/jsdoc/util/runtime'); - var cli = require('./cli'); - - function cb(errorCode) { - cli.logFinish(); - cli.exit(errorCode || 0); - } - - cli.setVersionInfo() - .loadConfig(); - - if (!global.env.opts.test) { - cli.configureLogger(); - } - - cli.logStart(); - - // On Rhino, we use a try/catch block so we can log the Java exception (if available) - if ( runtime.isRhino() ) { - try { - cli.runCommand(cb); - } - catch(e) { - if (e.rhinoException) { - logger.fatal( e.rhinoException.printStackTrace() ); - } else { - console.trace(e); - cli.exit(1); - } - } - } - else { - cli.runCommand(cb); - } -})(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/augment.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/augment.js deleted file mode 100644 index 7a3778f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/augment.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; - -var hasOwnProp = Object.prototype.hasOwnProperty; - -function mapDependencies(index) { - var doclets, doc, len, dependencies = {}; - - Object.keys(index).forEach(function(name) { - doclets = index[name]; - 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; - } - } - } - }); - - return dependencies; -} - -function Sorter(dependencies) { - this.dependencies = dependencies; - this.visited = {}; - this.sorted = []; -} - -Sorter.prototype.visit = function(key) { - var self = this; - - if (!(key in this.visited)) { - this.visited[key] = true; - - if (this.dependencies[key]) { - Object.keys(this.dependencies[key]).forEach(function(path) { - self.visit(path); - }); - } - - this.sorted.push(key); - } -}; - -Sorter.prototype.sort = function() { - var self = this; - - Object.keys(this.dependencies).forEach(function(key) { - self.visit(key); - }); - - return this.sorted; -}; - -function sort(dependencies) { - var sorter = new Sorter(dependencies); - return sorter.sort(); -} - -function getMembers(longname, docs) { - var candidate, members = []; - for (var i = 0, ii = docs.length; i < ii; ++i) { - candidate = docs[i]; - if (candidate.memberof === longname && candidate.scope === 'instance') { - members.push(candidate); - } - } - return members; -} - -function getAdditions(doclets, docs, longnames) { - var doop = require('jsdoc/util/doop'); - - var additions = []; - var doc; - var parents; - var members; - var member; - var parts; - - // doclets will be undefined if the inherited symbol isn't documented - doclets = doclets || []; - - for (var i = 0, ii = doclets.length; i < ii; i++) { - doc = doclets[i]; - parents = doc.augments; - if (parents && doc.kind === 'class') { - for (var j = 0, jj = parents.length; j < jj; j++) { - members = getMembers(parents[j], docs); - for (var k = 0, kk = members.length; k < kk; k++) { - member = doop(members[k]); - - if(!member.inherited) - { - member.inherits = member.longname; - } - member.inherited = true; - - 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); - } - } - } - } - } - return additions; -} - -exports.addInherited = function(docs) { - var dependencies = mapDependencies(docs.index); - var sorted = sort(dependencies); - var longnames = []; - - // 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; - } - }); - } - - 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] = []; - } - docs.index[name].push(doc); - docs.push(doc); - }); - }); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/borrow.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/borrow.js deleted file mode 100644 index 6f93ea9..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/borrow.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - A collection of functions relating to resolving @borrows tags in JSDoc symbols. - @module jsdoc/borrow - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var doop = require('jsdoc/util/doop'); -var logger = require('jsdoc/util/logger'); - -var hasOwnProp = Object.prototype.hasOwnProperty; - -exports.indexAll = function(docs) { - var lookupTable = {}; - - docs.forEach(function(doc) { - if ( !hasOwnProp.call(lookupTable, doc.longname) ) { - lookupTable[doc.longname] = []; - } - lookupTable[doc.longname].push(doc); - }); - docs.index = lookupTable; -}; - -// 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 - docs for the borrowing symbol. This process changes the symbols involved, - 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) { - 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; - - if (lent) { - var cloned = doop(lent); - - 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; - } - }); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/config.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/config.js deleted file mode 100644 index 6e95bfd..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/config.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ - -/** - @module jsdoc/config - */ -'use strict'; - -function mergeRecurse(target, source) { - Object.keys(source).forEach(function(p) { - if ( source[p].constructor === Object ) { - if ( !target[p] ) { target[p] = {}; } - mergeRecurse(target[p], source[p]); - } - else { - target[p] = source[p]; - } - }); - - return target; -} - -// required config values, override these defaults in your config.json if necessary -var defaults = { - tags: { - allowUnknownTags: true - }, - templates: { - monospaceLinks: false, - cleverLinks: false - }, - source: { - includePattern: '.+\\.js(doc)?$', - excludePattern: '' - }, - plugins: [] -}; - -/** - @class - @classdesc Represents a JSDoc application configuration. - @param {string} [json] - The contents of config.json. - */ -function Config(json) { - json = JSON.parse( (json || '{}') ); - this._config = mergeRecurse(defaults, json); -} - -module.exports = Config; - -/** - Get the merged configuration values. - */ -Config.prototype.get = function() { - return this._config; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/doclet.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/doclet.js deleted file mode 100644 index deb2d2e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/doclet.js +++ /dev/null @@ -1,416 +0,0 @@ -/** - * @overview - * @author Michael Mathews - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ - -/** - * @module jsdoc/doclet - */ -'use strict'; - -var _ = require('underscore'); -var jsdoc = { - name: require('jsdoc/name'), - src: { - astnode: require('jsdoc/src/astnode'), - Syntax: require('jsdoc/src/syntax').Syntax - }, - tag: { - Tag: require('jsdoc/tag').Tag, - dictionary: require('jsdoc/tag/dictionary') - }, - util: { - doop: require('jsdoc/util/doop') - } -}; -var path = require('jsdoc/path'); -var Syntax = jsdoc.src.Syntax; -var util = require('util'); - -function applyTag(doclet, tag) { - if (tag.title === 'name') { - doclet.name = tag.value; - } - - if (tag.title === 'kind') { - doclet.kind = tag.value; - } - - if (tag.title === 'description') { - doclet.description = tag.value; - } -} - -// use the meta info about the source code to guess what the doclet kind should be -function codeToKind(code) { - var parent; - - var isFunction = jsdoc.src.astnode.isFunction; - - // default - var kind = 'member'; - - if (code.type === Syntax.FunctionDeclaration || code.type === Syntax.FunctionExpression) { - kind = 'function'; - } - else if (code.node && code.node.parent) { - parent = code.node.parent; - if ( isFunction(parent) ) { - kind = 'param'; - } - } - - return kind; -} - -function unwrap(docletSrc) { - if (!docletSrc) { return ''; } - - // note: keep trailing whitespace for @examples - // extra opening/closing stars are ignored - // left margin is considered a star and a space - // use the /m flag on regex to avoid having to guess what this platform's newline is - docletSrc = - docletSrc.replace(/^\/\*\*+/, '') // remove opening slash+stars - .replace(/\**\*\/$/, '\\Z') // replace closing star slash with end-marker - .replace(/^\s*(\* ?|\\Z)/gm, '') // remove left margin like: spaces+star or spaces+end-marker - .replace(/\s*\\Z$/g, ''); // remove end-marker - - return docletSrc; -} - -function split(docletSrc) { - var tagSrcs = []; - - // 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 - .forEach(function($) { - var parsedTag; - var tagText; - var tagTitle; - - if ($) { - 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({ - title: tagTitle, - text: tagText - }); - } - } - } - }); - - 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; -} - -function fixDescription(docletSrc) { - if (!/^\s*@/.test(docletSrc)) { - docletSrc = '@description ' + docletSrc; - } - return docletSrc; -} - -/** - * @class - * @classdesc Represents a single JSDoc comment. - * @param {string} docletSrc - The raw source code of the jsdoc comment. - * @param {object=} meta - Properties describing the code related to this comment. - */ -var Doclet = exports.Doclet = function(docletSrc, meta) { - var newTags = []; - - /** The original text of the comment from the source code. */ - this.comment = docletSrc; - this.setMeta(meta); - - docletSrc = unwrap(docletSrc); - docletSrc = fixDescription(docletSrc); - - newTags = toTags.call(this, docletSrc); - - for (var i = 0, l = newTags.length; i < l; i++) { - this.addTag(newTags[i].title, newTags[i].text); - } - - this.postProcess(); -}; - -/** Called once after all tags have been added. */ -Doclet.prototype.postProcess = function() { - var i; - var l; - - if (!this.preserveName) { - jsdoc.name.resolve(this); - } - if (this.name && !this.longname) { - this.setLongname(this.name); - } - if (this.memberof === '') { - delete this.memberof; - } - - if (!this.kind && this.meta && this.meta.code) { - this.addTag( 'kind', codeToKind(this.meta.code) ); - } - - if (this.variation && this.longname && !/\)$/.test(this.longname) ) { - this.longname += '(' + this.variation + ')'; - } - - // add in any missing param names - if (this.params && this.meta && this.meta.code && this.meta.code.paramnames) { - for (i = 0, l = this.params.length; i < l; i++) { - if (!this.params[i].name) { - this.params[i].name = this.meta.code.paramnames[i] || ''; - } - } - } -}; - -/** - * Add a tag to the doclet. - * - * @param {string} title - The title of the tag being added. - * @param {string} [text] - The text of the tag being added. - */ -Doclet.prototype.addTag = function(title, text) { - var tagDef = jsdoc.tag.dictionary.lookUp(title), - newTag = new jsdoc.tag.Tag(title, text, this.meta); - - if (tagDef && tagDef.onTagged) { - tagDef.onTagged(this, newTag); - } - - if (!tagDef) { - this.tags = this.tags || []; - this.tags.push(newTag); - } - - applyTag(this, newTag); -}; - -function removeGlobal(longname) { - var globalRegexp = new RegExp('^' + jsdoc.name.GLOBAL_LONGNAME + '\\.?'); - - return longname.replace(globalRegexp, ''); -} - -/** - * Set the doclet's `memberof` property. - * - * @param {string} sid - The longname of the doclet's parent symbol. - */ -Doclet.prototype.setMemberof = function(sid) { - /** - * The longname of the symbol that contains this one, if any. - * @type string - */ - this.memberof = removeGlobal(sid) - .replace(/\.prototype/g, jsdoc.name.INSTANCE); -}; - -/** - * Set the doclet's `longname` property. - * - * @param {string} name - The longname for the doclet. - */ -Doclet.prototype.setLongname = function(name) { - /** - * The fully resolved symbol name. - * @type string - */ - this.longname = removeGlobal(name); - if (jsdoc.tag.dictionary.isNamespace(this.kind)) { - this.longname = jsdoc.name.applyNamespace(this.longname, this.kind); - } -}; - -/** - * Get the full path to the source file that is associated with a doclet. - * - * @private - * @param {module:jsdoc/doclet.Doclet} The doclet to check for a filepath. - * @return {string} The path to the doclet's source file, or an empty string if the path is not - * available. - */ -function getFilepath(doclet) { - if (!doclet || !doclet.meta || !doclet.meta.filename) { - return ''; - } - - return path.join(doclet.meta.path || '', doclet.meta.filename); -} - -/** - * Set the doclet's `scope` property. Must correspond to a scope name that is defined in - * {@link module:jsdoc/name.SCOPE_NAMES}. - * - * @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); - - 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); - if (filepath) { - errorMessage += util.format(' (Source file: %s)', filepath); - } - - throw new Error(errorMessage); - } - - this.scope = scope; -}; - -/** - * Add a symbol to this doclet's `borrowed` array. - * - * @param {string} source - The longname of the symbol that is the source. - * @param {string} target - The name the symbol is being assigned to. - */ -Doclet.prototype.borrow = function(source, target) { - var about = { from: source }; - if (target) { - about.as = target; - } - - if (!this.borrowed) { - /** - * A list of symbols that are borrowed by this one, if any. - * @type Array. - */ - this.borrowed = []; - } - this.borrowed.push(about); -}; - -Doclet.prototype.mix = function(source) { - /** - * A list of symbols that are mixed into this one, if any. - * @type Array. - */ - this.mixes = this.mixes || []; - this.mixes.push(source); -}; - -/** - * Add a symbol to the doclet's `augments` array. - * - * @param {string} base - The longname of the base symbol. - */ -Doclet.prototype.augment = function(base) { - /** - * A list of symbols that are augmented by this one, if any. - * @type Array. - */ - this.augments = this.augments || []; - this.augments.push(base); -}; - -/** - * Set the `meta` property of this doclet. - * - * @param {object} meta - */ -Doclet.prototype.setMeta = function(meta) { - /** - * Information about the source code associated with this doclet. - * @namespace - */ - this.meta = this.meta || {}; - - if (meta.range) { - /** - * The positions of the first and last characters of the code associated with this doclet. - * @type Array. - */ - this.meta.range = meta.range.slice(0); - } - - if (meta.lineno) { - /** - * The name of the file containing the code associated with this doclet. - * @type string - */ - this.meta.filename = path.basename(meta.filename); - /** - * The line number of the code associated with this doclet. - * @type number - */ - this.meta.lineno = meta.lineno; - - var pathname = path.dirname(meta.filename); - if (pathname && pathname !== '.') { - this.meta.path = pathname; - } - } - - /** - * Information about the code symbol. - * @namespace - */ - this.meta.code = this.meta.code || {}; - if (meta.id) { this.meta.code.id = meta.id; } - if (meta.code) { - if (meta.code.name) { - /** The name of the symbol in the source code. */ - this.meta.code.name = meta.code.name; - } - if (meta.code.type) { - /** The type of the symbol in the source code. */ - this.meta.code.type = meta.code.type; - } - // the AST node is only enumerable in debug mode, which reduces clutter for the - // --explain/-X option - if (meta.code.node) { - Object.defineProperty(this.meta.code, 'node', { - value: meta.code.node, - enumerable: global.env.opts.debug ? true : false - }); - } - if (meta.code.funcscope) { - this.meta.code.funcscope = meta.code.funcscope; - } - if (meta.code.value) { - /** The value of the symbol in the source code. */ - this.meta.code.value = meta.code.value; - } - if (meta.code.paramnames) { - this.meta.code.paramnames = meta.code.paramnames.slice(0); - } - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/fs.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/fs.js deleted file mode 100644 index 4bb8966..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/fs.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Extended version of the standard `fs` module. - * @module jsdoc/fs - */ -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var runtime = require('jsdoc/util/runtime'); - -var ls = exports.ls = function(dir, recurse, _allFiles, _path) { - var file; - var files; - var isFile; - - // first pass - if (_path === undefined) { - _allFiles = []; - _path = [dir]; - } - - if (!_path.length) { - return _allFiles; - } - - if (recurse === undefined) { - recurse = 1; - } - - try { - isFile = fs.statSync(dir).isFile(); - } - catch (e) { - isFile = false; - } - if (isFile) { - files = [dir]; - } - else { - files = fs.readdirSync(dir); - } - - for (var i = 0, l = files.length; i < l; i++) { - file = String(files[i]); - - // skip dot files - if (file.match(/^\.[^\.\/\\]/)) { - continue; - } - - if ( fs.statSync(path.join(_path.join('/'), file)).isDirectory() ) { - // it's a directory - _path.push(file); - - if (_path.length - 1 < recurse) { - ls(_path.join('/'), recurse, _allFiles, _path); - } - _path.pop(); - } - else { - // it's a file - _allFiles.push( path.normalize(path.join(_path.join('/'), file)) ); - } - } - - return _allFiles; -}; - -// export the VM-specific implementations of the extra methods -// TODO: document extra methods here -var extras = require( runtime.getModulePath('fs') ); -Object.keys(extras).forEach(function(extra) { - exports[extra] = extras[extra]; -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/name.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/name.js deleted file mode 100644 index aee46a8..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/name.js +++ /dev/null @@ -1,259 +0,0 @@ -/** - 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'); - -// 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 STATIC = exports.STATIC = '.'; -var scopeToPunc = exports.scopeToPunc = { - 'inner': INNER, - 'instance': INSTANCE, - 'static': STATIC -}; -var puncToScope = exports.puncToScope = _.invert(scopeToPunc); - -var DEFAULT_SCOPE = SCOPE_NAMES.static; -var REGEXP_SCOPE_PUNC = '([' + INNER + INSTANCE + STATIC + '])'; - -function nameIsLongname(name, memberof) { - var regexp = new RegExp('^' + memberof + REGEXP_SCOPE_PUNC); - - return regexp.test(name); -} - -function prototypeToPunc(name) { - return name.replace(/(?:^|\.)prototype\.?/g, INSTANCE); -} - -/** - 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; - - // change MyClass.prototype.instanceMethod to MyClass#instanceMethod - // (but not in function params, which lack doclet.kind) - // TODO: check for specific doclet.kind values (probably function, class, and module) - if (name && doclet.kind) { - name = prototypeToPunc(name); - } - doclet.name = name; - - // 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; - } - - if (memberof || doclet.forceMemberof) { // @memberof tag given - memberof = prototypeToPunc(memberof); - - // the name is a complete longname, like @name foo.bar, @memberof foo - if (name && nameIsLongname(name, memberof) && name !== memberof) { - about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); - } - // 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) { - about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); - } - // the name and memberof are identical, like @name foo, @memberof foo - else if (name && name === memberof) { - doclet.scope = doclet.scope || DEFAULT_SCOPE; - name = memberof + scopeToPunc[doclet.scope] + name; - about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); - } - // like @memberof foo# or @memberof foo~ - else if (name && trailingScope.test(memberof) ) { - about = exports.shorten(memberof + name, (doclet.forceMemberof ? memberof : undefined)); - } - else if (name && doclet.scope) { - about = exports.shorten(memberof + (scopeToPunc[doclet.scope] || '') + name, - (doclet.forceMemberof ? memberof : undefined)); - } - } - else { // no @memberof - about = exports.shorten(name); - } - - if (about.name) { - doclet.name = about.name; - } - - if (about.memberof) { - doclet.setMemberof(about.memberof); - } - - if (about.longname && (!doclet.longname || doclet.longname === doclet.name)) { - doclet.setLongname(about.longname); - } - - if (doclet.scope === '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'; - } - 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); - } - } - - if (about.variation) { - doclet.variation = about.variation; - } - - // if we never found a longname, just use an empty string - if (!doclet.longname) { - doclet.longname = ''; - } -}; - -// 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. - @param {string} ns The namespace to be applied. - @returns {string} The longname with the namespace applied. - */ -exports.applyNamespace = function(longname, ns) { - var nameParts = exports.shorten(longname), - name = nameParts.name; - longname = nameParts.longname; - - if ( !/^[a-zA-Z]+?:.+$/i.test(name) ) { - longname = longname.replace( new RegExp(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; - - // handle quoted names like foo["bar"] or foo['bar'] - longname = longname.replace(/(\[?["'].+?["']\]?)/g, function($) { - var dot = ''; - if ( /^\[/.test($) ) { - dot = '.'; - $ = $.replace( /^\[/g, '' ).replace( /\]$/g, '' ); - } - - token = '@{' + atoms.length + '}@'; - atoms.push($); - - return dot + token; // foo["bar"] => foo.@{1}@ - }); - - var name = '', - scope = '', // ., ~, or # - memberof = '', - parts, - variation; - - longname = prototypeToPunc(longname); - - if (typeof forcedMemberof !== 'undefined') { - name = longname.substr(forcedMemberof.length); - parts = forcedMemberof.match(/^(.*?)([#.~]?)$/); - - if (parts[1]) { memberof = parts[1] || forcedMemberof; } - if (parts[2]) { scope = 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 # - memberof = parts[2] || ''; - } - - // like /** @name foo.bar(2) */ - if ( /(.+)\(([^)]+)\)$/.test(name) ) { - name = RegExp.$1; - variation = RegExp.$2; - } - - //// restore quoted strings back again - var i = atoms.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]); - } - - //// - return {longname: longname, memberof: memberof, scope: scope, name: name, variation: variation}; -}; - -/** - Split a string that starts with a name and ends with a description into its parts. - @param {string} nameDesc - @returns {object} Hash with "name" and "description" properties. - */ -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]*))?$/); - return { - name: RegExp.$1, - description: RegExp.$3 - }; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/opts/argparser.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/opts/argparser.js deleted file mode 100644 index c33db9d..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/opts/argparser.js +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Parse the command line arguments. - * @module jsdoc/opts/argparser - * @author Michael Mathews - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var _ = require('underscore'); - -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 - */ -var ArgParser = function() { - this._options = []; - this._shortNameIndex = {}; - this._longNameIndex = {}; -}; - -ArgParser.prototype._getOptionByShortName = function(name) { - if (hasOwnProp.call(this._shortNameIndex, name)) { - return this._options[this._shortNameIndex[name]]; - } - return null; -}; - -ArgParser.prototype._getOptionByLongName = function(name) { - if (hasOwnProp.call(this._longNameIndex, name)) { - return this._options[this._longNameIndex[name]]; - } - return null; -}; - -ArgParser.prototype._addOption = function(option) { - var currentIndex; - - var longName = option.longName; - var shortName = option.shortName; - - this._options.push(option); - currentIndex = this._options.length - 1; - - if (shortName) { - this._shortNameIndex[shortName] = currentIndex; - } - if (longName) { - this._longNameIndex[longName] = currentIndex; - } - - return this; -}; - -/** - * Provide information about a legal option. - * @param {character} shortName The short name of the option, entered like: -T. - * @param {string} longName The equivalent long name of the option, entered like: --test. - * @param {boolean} hasValue Does this option require a value? Like: -t templatename - * @param {string} helpText A brief description of the option. - * @param {boolean} [canHaveMultiple=false] Set to `true` if the option can be provided more than once. - * @param {function} [coercer] A function to coerce the given value to a specific type. - * @return {this} - * @example - * myParser.addOption('t', 'template', true, 'The path to the template.'); - * myParser.addOption('h', 'help', false, 'Show the help message.'); - */ -ArgParser.prototype.addOption = function(shortName, longName, hasValue, helpText, canHaveMultiple, coercer) { - var option = { - shortName: shortName, - longName: longName, - hasValue: hasValue, - helpText: helpText, - canHaveMultiple: (canHaveMultiple || false), - coercer: coercer - }; - - return this._addOption(option); -}; - -// TODO: refactor addOption to accept objects, then get rid of this method -/** - * Provide information about an option that should not cause an error if present, but that is always - * ignored (for example, an option that was used in previous versions but is no longer supported). - * - * @private - * @param {string} shortName - The short name of the option with a leading hyphen (for example, - * `-v`). - * @param {string} longName - The long name of the option with two leading hyphens (for example, - * `--version`). - */ -ArgParser.prototype.addIgnoredOption = function(shortName, longName) { - var option = { - shortName: shortName, - longName: longName, - ignore: true - }; - - return this._addOption(option); -}; - -function padding(length) { - return new Array(length + 1).join(' '); -} - -function padLeft(str, length) { - return padding(length) + str; -} - -function padRight(str, length) { - return str + padding(length); -} - -function findMaxLength(arr) { - var max = 0; - - arr.forEach(function(item) { - if (item.length > max) { - max = item.length; - } - }); - - return max; -} - -function concatWithMaxLength(items, maxLength) { - var result = ''; - // to prevent endless loops, always use the first item, regardless of length - result += items.shift(); - - while ( items.length && (result.length + items[0].length < maxLength) ) { - result += ' ' + items.shift(); - } - - return result; -} - -// we want to format names and descriptions like this: -// | -f, --foo Very long description very long description very long | -// | description very long description. | -function formatHelpInfo(options) { - var MARGIN_LENGTH = 4; - var results = []; - - var maxLength = process.stdout.columns; - var maxNameLength = findMaxLength(options.names); - var maxDescriptionLength = findMaxLength(options.descriptions); - - var wrapDescriptionAt = maxLength - (MARGIN_LENGTH * 3) - maxNameLength; - // build the string for each option - options.names.forEach(function(name, i) { - var result; - var partialDescription; - var words; - - // add a left margin to the name - result = padLeft(options.names[i], MARGIN_LENGTH); - // and a right margin, with extra padding so the descriptions line up with one another - result = padRight(result, maxNameLength - options.names[i].length + MARGIN_LENGTH); - - // split the description on spaces - words = options.descriptions[i].split(' '); - // add as much of the description as we can fit on the first line - result += concatWithMaxLength(words, wrapDescriptionAt); - // if there's anything left, keep going until we've consumed the description - while (words.length) { - partialDescription = padding( maxNameLength + (MARGIN_LENGTH * 2) ); - partialDescription += concatWithMaxLength(words, wrapDescriptionAt); - result += '\n' + partialDescription; - } - - results.push(result); - }); - - return results; -} - -/** - * Generate a summary of all the options with corresponding help text. - * @returns {string} - */ -ArgParser.prototype.help = function() { - var options = { - names: [], - descriptions: [] - }; - - this._options.forEach(function(option) { - var name = ''; - - // don't show ignored options - if (option.ignore) { - return; - } - - if (option.shortName) { - name += '-' + option.shortName + (option.longName ? ', ' : ''); - } - - if (option.longName) { - name += '--' + option.longName; - } - - if (option.hasValue) { - name += ' '; - } - - options.names.push(name); - options.descriptions.push(option.helpText); - }); - - return 'Options:\n' + formatHelpInfo(options).join('\n'); -}; - -/** - * Get the options. - * @param {Array.} args An array, like ['-x', 'hello'] - * @param {Object} [defaults={}] An optional collection of default values. - * @returns {Object} The keys will be the longNames, or the shortName if no longName is defined for - * that option. The values will be the values provided, or `true` if the option accepts no value. - */ -ArgParser.prototype.parse = function(args, defaults) { - var result = defaults && _.defaults({}, defaults) || {}; - - result._ = []; - for (var i = 0, leni = args.length; i < leni; i++) { - var arg = '' + args[i], - next = (i < leni - 1) ? '' + args[i + 1] : null, - option, - shortName = null, - longName, - name, - value = null; - - // like -t - if (arg.charAt(0) === '-') { - - // like --template - if (arg.charAt(1) === '-') { - name = longName = arg.slice(2); - option = this._getOptionByLongName(longName); - } - else { - name = shortName = arg.slice(1); - option = this._getOptionByShortName(shortName); - } - - if (option === null) { - throw new Error( 'Unknown command line option found: ' + name ); - } - - if (option.hasValue) { - value = next; - i++; - - if (value === null || value.charAt(0) === '-') { - throw new Error( 'Command line option requires a value: ' + name ); - } - } - else { - value = true; - } - - // skip ignored options now that we've consumed the option text - if (option.ignore) { - continue; - } - - if (option.longName && shortName) { - name = option.longName; - } - - if (typeof option.coercer === 'function') { - value = option.coercer(value); - } - - // Allow for multiple options of the same type to be present - if (option.canHaveMultiple && hasOwnProp.call(result, name)) { - var val = result[name]; - - if (val instanceof Array) { - val.push(value); - } else { - result[name] = [val, value]; - } - } - else { - result[name] = value; - } - } - else { - result._.push(arg); - } - } - - return result; -}; - -module.exports = ArgParser; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/opts/args.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/opts/args.js deleted file mode 100644 index bddd565..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/opts/args.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @module jsdoc/opts/args - * @requires jsdoc/opts/argparser - * @author Michael Mathews - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var ArgParser = require('jsdoc/opts/argparser'); -var querystring = require('querystring'); -var util = require('util'); - -var ourOptions; - -var argParser = new ArgParser(); -var hasOwnProp = Object.prototype.hasOwnProperty; - -// cast strings to booleans or integers where appropriate -function castTypes(item) { - var integer; - - var result = item; - - switch (result) { - case 'true': - result = true; - break; - - case 'false': - result = false; - break; - - default: - // might be an integer - integer = parseInt(result, 10); - if (String(integer) === result && integer !== 'NaN') { - result = integer; - } - } - - return result; -} - -// check for strings that we need to cast to other types -function fixTypes(item) { - var result = item; - - // recursively process arrays and objects - if ( util.isArray(result) ) { - for (var i = 0, l = result.length; i < l; i++) { - result[i] = fixTypes(result[i]); - } - } - else if (typeof result === 'object') { - Object.keys(result).forEach(function(prop) { - result[prop] = fixTypes(result[prop]); - }); - } - else { - result = castTypes(result); - } - - return result; -} - -function parseQuery(str) { - var result = querystring.parse(str); - - Object.keys(result).forEach(function(prop) { - result[prop] = fixTypes(result[prop]); - }); - - return result; -} - -argParser.addOption('t', 'template', true, 'The path to the template to use. Default: path/to/jsdoc/templates/default'); -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('h', 'help', false, 'Print this message and quit.'); -argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.'); -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('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.'); - -// Options that are no longer supported and should be ignored -argParser.addIgnoredOption('l', 'lenient'); // removed in JSDoc 3.3.0 - -/** - * Set the options for this app. - * @throws {Error} Illegal arguments will throw errors. - * @param {string|String[]} args The command line arguments for this app. - */ -exports.parse = function(args) { - args = args || []; - - if (typeof args === 'string' || args.constructor === String) { - args = String(args).split(/\s+/g); - } - - ourOptions = argParser.parse(args); - - return ourOptions; -}; - -/** - * Retrieve help message for options. - */ -exports.help = function() { - return argParser.help(); -}; - -/** - * Get a named option. - * @param {string} name The name of the option. - * @return {string} The value associated with the given name. - *//** - * Get all the options for this app. - * @return {Object} A collection of key/values representing all the options. - */ -exports.get = function(name) { - if (typeof name === 'undefined') { - return ourOptions; - } - else if ( hasOwnProp.call(ourOptions, name) ) { - return ourOptions[name]; - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/package.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/package.js deleted file mode 100644 index 135c9ab..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/package.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -/** - @module jsdoc/package - @see http://wiki.commonjs.org/wiki/Packages/1.0 - */ - -/** - @class - @classdesc Represents a JavaScript package. - @param {string} json - The contents of package.json. - */ -exports.Package = function(json) { - json = json || '{}'; - - /** The source files associated with this package. - @type {Array} - */ - this.files = []; - - /** The kind of this package. - @readonly - @default - @type {string} - */ - this.kind = 'package'; - - json = JSON.parse(json); - - /** 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; - - /** The longname of this package. - @type {string} - */ - this.longname = this.kind + ':' + this.name; - - /** The description of this package. - @type {string} - */ - this.description = json.description; - - /** - 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; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/path.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/path.js deleted file mode 100644 index 3b8b660..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/path.js +++ /dev/null @@ -1,134 +0,0 @@ -/*global env: true */ -/** - * Extended version of the standard `path` module. - * @module jsdoc/path - */ -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var runtime = require('jsdoc/util/runtime'); - -function prefixReducer(previousPath, current) { - var currentPath = []; - - // if previousPath is defined, but has zero length, there's no common prefix; move along - if (previousPath && !previousPath.length) { - return currentPath; - } - - currentPath = path.resolve(global.env.pwd, current).split(path.sep) || []; - - if (previousPath && currentPath.length) { - // remove chunks that exceed the previous path's length - currentPath = currentPath.slice(0, previousPath.length); - - // if a chunk doesn't match the previous path, remove everything from that chunk on - for (var i = 0, l = currentPath.length; i < l; i++) { - if (currentPath[i] !== previousPath[i]) { - currentPath.splice(i, currentPath.length - i); - break; - } - } - } - - return currentPath; -} - -/** - * Find the common prefix for an array of paths. If there is a common prefix, a trailing separator - * is appended to the prefix. Relative paths are resolved relative to the current working directory. - * - * For example, assuming that the current working directory is `/Users/jsdoc`: - * - * + For the single path `foo/bar/baz/qux.js`, the common prefix is `foo/bar/baz/`. - * + For paths `foo/bar/baz/qux.js`, `foo/bar/baz/quux.js`, and `foo/bar/baz.js`, the common prefix - * is `/Users/jsdoc/foo/bar/`. - * + For paths `../jsdoc/foo/bar/baz/qux/quux/test.js`, `/Users/jsdoc/foo/bar/bazzy.js`, and - * `../../Users/jsdoc/foo/bar/foobar.js`, the common prefix is `/Users/jsdoc/foo/bar/`. - * + For paths `foo/bar/baz/qux.js` and `../../Library/foo/bar/baz.js`, there is no common prefix, - * and an empty string is returned. - * - * @param {Array.} paths - The paths to search for a common prefix. - * @return {string} The common prefix, or an empty string if there is no common prefix. - */ -exports.commonPrefix = function(paths) { - var segments; - - var prefix = ''; - - paths = paths || []; - - // if there's only one path, its resolved dirname (plus a trailing slash) is the common prefix - if (paths.length === 1) { - prefix = path.resolve(global.env.pwd, paths[0]); - if ( path.extname(prefix) ) { - prefix = path.dirname(prefix); - } - - prefix += path.sep; - } - else { - segments = paths.reduce(prefixReducer, undefined) || []; - - // if there's anything left (other than a placeholder for a leading slash), add a - // placeholder for a trailing slash - if ( segments.length && (segments.length > 1 || segments[0] !== '') ) { - segments.push(''); - } - - prefix = segments.join(path.sep); - } - - return prefix; -}; - -/** - * Retrieve the fully qualified path to the requested resource. - * - * If the resource path is specified as a relative path, JSDoc searches for the path in the - * directory where the JSDoc configuration file is located, then in the current working directory, - * and finally in the JSDoc directory. - * - * If the resource path is specified as a fully qualified path, JSDoc uses the path as-is. - * - * @param {string} filepath - The path to the requested resource. May be an absolute path; a path - * relative to the JSDoc directory; or a path relative to the current working directory. - * @param {string} [filename] - The filename of the requested resource. - * @return {string} The fully qualified path (or, on Rhino, a URI) to the requested resource. - * Includes the filename if one was provided. - */ -exports.getResourcePath = function(filepath, filename) { - var result = null; - - function pathExists(_path) { - try { - fs.readdirSync(_path); - } - catch(e) { - return false; - } - - return true; - } - - // absolute paths are normalized by path.resolve on the first pass - [path.dirname(global.env.opts.configure || ''), env.pwd, env.dirname].forEach(function(_path) { - if (!result && _path) { - _path = path.resolve(_path, filepath); - if ( pathExists(_path) ) { - result = _path; - } - } - }); - - if (result) { - result = filename ? path.join(result, filename) : result; - } - - return result; -}; - -Object.keys(path).forEach(function(member) { - exports[member] = path[member]; -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/plugins.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/plugins.js deleted file mode 100644 index a34fccc..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/plugins.js +++ /dev/null @@ -1,53 +0,0 @@ -/*global app: true */ -/** - * Utility functions to support the JSDoc plugin framework. - * @module jsdoc/plugins - */ -'use strict'; - -var logger = require('jsdoc/util/logger'); -var path = require('jsdoc/path'); - -function addHandlers(handlers, parser) { - Object.keys(handlers).forEach(function(eventName) { - parser.on(eventName, handlers[eventName]); - }); -} - -exports.installPlugins = function(plugins, parser) { - var dictionary = require('jsdoc/tag/dictionary'); - - var eventName; - var plugin; - - for (var i = 0, l = plugins.length; i < l; i++) { - plugin = require(plugins[i]); - - // allow user-defined plugins to... - //...register event handlers - if (plugin.handlers) { - addHandlers(plugin.handlers, parser); - } - - //...define tags - if (plugin.defineTags) { - plugin.defineTags(dictionary); - } - - //...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 ' + - 'is not using the Rhino JavaScript parser.', plugins[i]); - } - else { - parser.addNodeVisitor(plugin.nodeVisitor); - } - } - - //...add a Mozilla Parser API node visitor - if (plugin.astNodeVisitor) { - parser.addAstNodeVisitor(plugin.astNodeVisitor); - } - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/readme.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/readme.js deleted file mode 100644 index f24317a..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/readme.js +++ /dev/null @@ -1,26 +0,0 @@ -/*global env: true */ - -/** - * Make the contents of a README file available to include in the output. - * @module jsdoc/readme - * @author Michael Mathews - * @author Ben Blank - */ -'use strict'; - -var fs = require('jsdoc/fs'), - markdown = require('jsdoc/util/markdown'); - -/** - * @class - * @classdesc Represents a README file. - * @param {string} path - The filepath to the README. - */ -function ReadMe(path) { - var content = fs.readFileSync(path, env.opts.encoding), - parse = markdown.getParser(); - - this.html = parse(content); -} - -module.exports = ReadMe; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/schema.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/schema.js deleted file mode 100644 index 0444c6f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/schema.js +++ /dev/null @@ -1,624 +0,0 @@ -/** - * @overview Schema for validating JSDoc doclets. - * - * @author Michael Mathews - * @author Jeff Williams - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - * @see - */ -'use strict'; - -// JSON schema types -var ARRAY = 'array'; -var BOOLEAN = 'boolean'; -var INTEGER = 'integer'; -var NULL = 'null'; -var NUMBER = 'number'; -var OBJECT = 'object'; -var STRING = 'string'; -var UNDEFINED = 'undefined'; - -var BOOLEAN_OPTIONAL = [BOOLEAN, NULL, UNDEFINED]; -var STRING_OPTIONAL = [STRING, NULL, UNDEFINED]; - -var EVENT_REGEXP = /event\:[\S]+/; -var PACKAGE_REGEXP = /package\:[\S]+/; - -// information about the code associated with a doclet -var META_SCHEMA = exports.META_SCHEMA = { - type: OBJECT, - optional: true, - additionalProperties: false, - properties: { - code: { - type: OBJECT, - additionalProperties: false, - properties: { - funcscope: { - type: STRING, - optional: true - }, - id: { - type: STRING, - optional: true - }, - name: { - type: STRING, - optional: true - }, - node: { - type: OBJECT, - optional: true - }, - paramnames: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING - } - }, - type: { - type: STRING, - optional: true - }, - value: { - optional: true - } - } - }, - filename: { - title: 'The name of the file that contains the code associated with this doclet.', - type: STRING, - optional: true - }, - lineno: { - title: 'The line number of the code associated with this doclet.', - type: NUMBER, - optional: true - }, - path: { - title: 'The path in which the code associated with this doclet is located.', - type: STRING, - optional: true - }, - range: { - title: 'The positions of the first and last characters of the code associated with ' + - 'this doclet.', - type: ARRAY, - optional: true, - minItems: 2, - maxItems: 2, - items: { - type: NUMBER - } - }, - vars: { - type: OBJECT - } - } -}; - -// type property containing type names -var TYPE_PROPERTY_SCHEMA = exports.TYPE_PROPERTY_SCHEMA = { - type: OBJECT, - additionalProperties: false, - properties: { - names: { - type: ARRAY, - minItems: 1, - items: { - type: STRING - } - } - } -}; - -// enumeration properties -var ENUM_PROPERTY_SCHEMA = exports.ENUM_PROPERTY_SCHEMA = { - type: OBJECT, - additionalProperties: false, - properties: { - comment: { - type: STRING - }, - defaultvalue: { - type: STRING_OPTIONAL, - optional: true - }, - description: { - type: STRING_OPTIONAL, - optional: true - }, - kind: { - type: STRING, - // TODO: get this from a real enum somewhere - enum: ['member'] - }, - longname: { - type: STRING - }, - memberof: { - type: STRING, - optional: true - }, - meta: META_SCHEMA, - name: { - type: STRING - }, - // is this member nullable? (derived from the type expression) - nullable: { - type: BOOLEAN_OPTIONAL - }, - // is this member optional? (derived from the type expression) - optional: { - type: BOOLEAN_OPTIONAL - }, - scope: { - type: STRING, - // TODO: get this from a real enum somewhere - enum: ['static'] - }, - type: TYPE_PROPERTY_SCHEMA, - // can this member be provided more than once? (derived from the type expression) - variable: { - type: BOOLEAN_OPTIONAL - } - } -}; - -// function parameter, or object property defined with @property tag -var PARAM_SCHEMA = exports.PARAM_SCHEMA = { - type: OBJECT, - additionalProperties: false, - properties: { - // what is the default value for this parameter? - defaultvalue: { - type: STRING_OPTIONAL, - optional: true - }, - // a description of the parameter - description: { - type: STRING_OPTIONAL, - optional: true - }, - // what name does this parameter have within the function? - name: { - type: STRING - }, - // can the value for this parameter be null? - nullable: { - type: BOOLEAN_OPTIONAL, - optional: true - }, - // is a value for this parameter optional? - optional: { - type: BOOLEAN_OPTIONAL, - optional: true - }, - // what are the types of value expected for this parameter? - type: TYPE_PROPERTY_SCHEMA, - // can this parameter be repeated? - variable: { - type: BOOLEAN_OPTIONAL, - optional: true - } - } -}; - -var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { - type: OBJECT, - additionalProperties: false, - properties: { - // what access privileges are allowed - access: { - type: STRING, - optional: true, - // TODO: define this as an enumeration elsewhere - enum: [ - 'private', - 'protected' - ] - }, - alias: { - type: STRING, - optional: true - }, - augments: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING - } - }, - author: { - type: ARRAY, - optional: true, - items: { - type: STRING - } - }, - borrowed: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: OBJECT, - additionalProperties: false, - properties: { - // name of the target - as: { - type: STRING, - optional: true - }, - // name of the source - from: { - type: STRING - } - } - } - }, - // a description of the class that this constructor belongs to - classdesc: { - type: STRING, - optional: true - }, - comment: { - type: STRING - }, - copyright: { - type: STRING, - optional: true - }, - defaultvalue: { - optional: true - }, - defaultvaluetype: { - type: STRING, - optional: true, - enum: [OBJECT, ARRAY] - }, - // is usage of this symbol deprecated? - deprecated: { - type: [STRING, BOOLEAN], - optional: true - }, - // a description - description: { - type: STRING_OPTIONAL, - optional: true - }, - // something else to consider - examples: { - type: ARRAY, - optional: true, - items: { - type: STRING - } - }, - exceptions: { - type: ARRAY, - optional: true, - items: PARAM_SCHEMA - }, - // the path to another constructor - extends: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING - } - }, - // the path to another doc object - fires: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING, - pattern: EVENT_REGEXP - } - }, - forceMemberof: { - type: BOOLEAN_OPTIONAL, - optional: true - }, - ignore: { - type: BOOLEAN, - optional: true - }, - implements: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING - } - }, - inherited: { - type: BOOLEAN, - optional: true - }, - inherits: { - type: STRING, - optional: true, - dependency: { - inherited: true - } - }, - isEnum: { - type: BOOLEAN, - optional: true - }, - // what kind of symbol is this? - kind: { - type: STRING, - // TODO: define this as an enumeration elsewhere - enum: [ - 'class', - 'constant', - 'event', - 'external', - 'file', - 'function', - 'member', - 'mixin', - 'module', - 'namespace', - 'package', - 'param', - 'typedef' - ] - }, - license: { - type: STRING, - optional: true - }, - listens: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING, - pattern: EVENT_REGEXP - } - }, - longname: { - type: STRING - }, - // probably a leading substring of the path - memberof: { - type: STRING, - optional: true - }, - // information about this doc - meta: META_SCHEMA, - mixes: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: { - type: STRING - } - }, - // probably a trailing substring of the path - name: { - type: STRING - }, - // is this member nullable? (derived from the type expression) - nullable: { - type: BOOLEAN_OPTIONAL - }, - // is this member optional? (derived from the type expression) - optional: { - type: BOOLEAN_OPTIONAL - }, - // are there function parameters associated with this doc? - params: { - type: ARRAY, - optional: true, - uniqueItems: true, - items: PARAM_SCHEMA - }, - preserveName: { - type: BOOLEAN, - optional: true - }, - properties: { - type: ARRAY, - optional: true, - uniqueItems: true, - minItems: 1, - items: { - anyOf: [ENUM_PROPERTY_SCHEMA, PARAM_SCHEMA] - } - }, - readonly: { - type: BOOLEAN, - optional: true - }, - // the symbol being documented requires another symbol - requires: { - type: ARRAY, - optional: true, - uniqueItems: true, - minItems: 1, - items: { - type: STRING - } - }, - returns: { - type: ARRAY, - optional: true, - minItems: 1, - items: PARAM_SCHEMA - }, - // what sort of parent scope does this symbol have? - scope: { - type: STRING, - enum: [ - // TODO: make these an enumeration - 'global', - 'inner', - 'instance', - 'static' - ] - }, - // something else to consider - see: { - type: ARRAY, - optional: true, - minItems: 1, - items: { - type: STRING - } - }, - // at what previous version was this doc added? - since: { - type: STRING, - optional: true - }, - summary: { - type: STRING, - optional: true - }, - // arbitrary tags associated with this doc - tags: { - type: ARRAY, - optional: true, - minItems: 1, - items: { - type: OBJECT, - additionalProperties: false, - properties: { - originalTitle: { - type: STRING - }, - text: { - type: STRING, - optional: true - }, - title: { - type: STRING - }, - value: { - type: [STRING, OBJECT], - optional: true, - properties: PARAM_SCHEMA - } - } - } - }, - 'this': { - type: STRING, - optional: true - }, - todo: { - type: ARRAY, - optional: true, - minItems: 1, - items: { - type: STRING - } - }, - // extended tutorials - tutorials: { - type: ARRAY, - optional: true, - minItems: 1, - items: { - type: STRING - } - }, - // what type is the value that this doc is associated with, like `number` - type: TYPE_PROPERTY_SCHEMA, - undocumented: { - type: BOOLEAN, - optional: true - }, - // can this member be provided more than once? (derived from the type expression) - variable: { - type: BOOLEAN_OPTIONAL - }, - variation: { - type: STRING, - optional: true - }, - // what is the version of this doc - version: { - type: STRING, - optional: true - }, - // is a member left to be implemented during inheritance? - virtual: { - type: BOOLEAN, - optional: true - } - } -}; - -var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { - type: OBJECT, - additionalProperties: false, - properties: { - description: { - type: STRING, - optional: true - }, - files: { - type: ARRAY, - uniqueItems: true, - minItems: 1, - items: { - type: STRING - } - }, - kind: { - type: STRING, - enum: ['package'] - }, - licenses: { - type: ARRAY, - optional: true, - minItems: 1, - items: { - type: OBJECT, - additionalProperties: false, - properties: { - type: { - type: STRING, - optional: true - }, - url: { - type: STRING, - optional: true, - format: 'uri' - } - } - } - }, - longname: { - type: STRING, - optional: true, - pattern: PACKAGE_REGEXP - }, - name: { - type: STRING, - optional: true - }, - version: { - type: STRING, - optional: true - } - } -}; - -var DOCLETS_SCHEMA = exports.DOCLETS_SCHEMA = { - type: ARRAY, - uniqueItems: true, - items: { - anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA] - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/filter.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/filter.js deleted file mode 100644 index 135c4c4..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/filter.js +++ /dev/null @@ -1,67 +0,0 @@ -/*global env: true */ -/** - @module jsdoc/src/filter - - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var path = require('jsdoc/path'); - -var pwd = env.pwd; - -function makeRegExp(config) { - var regExp = null; - - if (config) { - regExp = (typeof config === 'string') ? new RegExp(config) : config; - } - - return regExp; -} - -/** - @constructor - @param {object} opts - @param {string[]} opts.exclude - Specific files to exclude. - @param {string|RegExp} opts.includePattern - @param {string|RegExp} opts.excludePattern - */ -exports.Filter = function(opts) { - this.exclude = opts.exclude && Array.isArray(opts.exclude) ? - opts.exclude.map(function($) { - return path.resolve(pwd, $); - }) : - null; - this.includePattern = makeRegExp(opts.includePattern); - this.excludePattern = makeRegExp(opts.excludePattern); -}; - -/** - @param {string} filepath - The filepath to check. - @returns {boolean} Should the given file be included? - */ -exports.Filter.prototype.isIncluded = function(filepath) { - var included = true; - - filepath = path.resolve(pwd, filepath); - - if ( this.includePattern && !this.includePattern.test(filepath) ) { - included = false; - } - - if ( this.excludePattern && this.excludePattern.test(filepath) ) { - included = false; - } - - if (this.exclude) { - this.exclude.forEach(function(exclude) { - if ( filepath.indexOf(exclude) === 0 ) { - included = false; - } - }); - } - - return included; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/handlers.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/handlers.js deleted file mode 100644 index f25368e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/handlers.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * @module jsdoc/src/handlers - */ -'use strict'; - -var jsdoc = { - doclet: require('jsdoc/doclet'), - name: require('jsdoc/name'), - util: { - logger: require('jsdoc/util/logger') - } -}; -var util = require('util'); - -var currentModule = null; - -var moduleRegExp = /^((?:module.)?exports|this)(\.|$)/; - -function getNewDoclet(comment, e) { - var Doclet = jsdoc.doclet.Doclet; - var doclet; - var err; - - try { - doclet = new 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); - } - - return doclet; -} - -function setCurrentModule(doclet) { - if (doclet.kind === 'module') { - currentModule = doclet.longname; - } -} - -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 - if (!doclet.scope) { - doclet.addTag('inner'); - } - - if (!doclet.memberof && doclet.scope !== 'global') { - doclet.addTag('memberof', currentModule); - } - } -} - -/** - * 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 - parser.on('jsdocCommentFound', function(e) { - var newDoclet = getNewDoclet(e.comment, e); - - if (!newDoclet.name) { - return false; // only interested in virtual comments (with a @name) here - } - - 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 - parser.on('symbolFound', function(e) { - var subDoclets = e.comment.split(/@also\b/g); - - for (var i = 0, l = subDoclets.length; i < l; i++) { - newSymbolDoclet.call(parser, subDoclets[i], e); - } - }); - - parser.on('fileComplete', function(e) { - currentModule = null; - }); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/parser.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/parser.js deleted file mode 100644 index 121bf0f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/parser.js +++ /dev/null @@ -1,500 +0,0 @@ -/*global env, Packages */ -/*eslint no-script-url:0 */ -/** - * @module jsdoc/src/parser - */ -'use strict'; - -var jsdoc = { - doclet: require('jsdoc/doclet'), - name: require('jsdoc/name'), - src: { - astnode: require('jsdoc/src/astnode'), - syntax: require('jsdoc/src/syntax') - } -}; -var logger = require('jsdoc/util/logger'); -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; -} - -// 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'; - } - - if (PARSERS[type]) { - modulePath = PARSERS[type]; - } - else { - modulePath = path.join( path.getResourcePath(path.dirname(type)), path.basename(type) ); - } - - try { - return new ( require(modulePath) ).Parser(); - } - catch (e) { - logger.fatal('Unable to create the parser type "' + type + '": ' + e); - } -}; - -// TODO: docs -/** - * @class - * @mixes module:events.EventEmitter - * - * @example Create a new parser. - * var jsdocParser = new (require('jsdoc/src/parser').Parser)(); - */ -var Parser = exports.Parser = function(builderInstance, visitorInstance, walkerInstance) { - this.clear(); - - this._astBuilder = builderInstance || new (require('jsdoc/src/astbuilder')).AstBuilder(); - this._visitor = visitorInstance || new (require('jsdoc/src/visitor')).Visitor(this); - this._walker = walkerInstance || new (require('jsdoc/src/walker')).Walker(); - - Object.defineProperties(this, { - astBuilder: { - get: function() { - return this._astBuilder; - } - }, - visitor: { - get: function() { - return this._visitor; - } - }, - walker: { - get: function() { - return this._walker; - } - } - }); -}; -util.inherits(Parser, require('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 = {}; -}; - -// TODO: update docs -/** - * Parse the given source files for JSDoc comments. - * @param {Array.} sourceFiles An array of filepaths to the JavaScript sources. - * @param {string} [encoding=utf8] - * - * @fires module:jsdoc/src/parser.Parser.parseBegin - * @fires module:jsdoc/src/parser.Parser.fileBegin - * @fires module:jsdoc/src/parser.Parser.jsdocCommentFound - * @fires module:jsdoc/src/parser.Parser.symbolFound - * @fires module:jsdoc/src/parser.Parser.newDoclet - * @fires module:jsdoc/src/parser.Parser.fileComplete - * @fires module:jsdoc/src/parser.Parser.parseComplete - * - * @example Parse two source files. - * var myFiles = ['file1.js', 'file2.js']; - * var docs = jsdocParser.parse(myFiles); - */ -Parser.prototype.parse = function(sourceFiles, encoding) { - encoding = encoding || env.conf.encoding || 'utf8'; - - var filename = ''; - var sourceCode = ''; - var parsedFiles = []; - var e = {}; - - if (typeof sourceFiles === 'string') { - sourceFiles = [sourceFiles]; - } - - e.sourcefiles = sourceFiles; - logger.debug('Parsing source files: %j', sourceFiles); - - this.emit('parseBegin', e); - - for (var i = 0, l = sourceFiles.length; i < l; i++) { - sourceCode = ''; - - if (sourceFiles[i].indexOf(SCHEMA) === 0) { - sourceCode = sourceFiles[i].substr(SCHEMA.length); - filename = '[[string' + i + ']]'; - } - else { - filename = sourceFiles[i]; - try { - sourceCode = require('jsdoc/fs').readFileSync(filename, encoding); - } - catch(e) { - logger.error('Unable to read and parse the source file %s: %s', filename, e); - } - } - - if (sourceCode.length) { - this._parseSourceCode(sourceCode, filename); - parsedFiles.push(filename); - } - } - - this.emit('parseComplete', { - sourcefiles: parsedFiles, - doclets: this._resultBuffer - }); - logger.debug('Finished parsing source files.'); - - return this._resultBuffer; -}; - -// TODO: docs -Parser.prototype.fireProcessingComplete = function(doclets) { - this.emit('processingComplete', { doclets: doclets }); -}; - -// TODO: docs -Parser.prototype.results = function() { - return this._resultBuffer; -}; - -// TODO: update docs -/** - * @param {Object} o The parse result to add to the result buffer. - */ -Parser.prototype.addResult = function(o) { - this._resultBuffer.push(o); -}; - -// TODO: docs -Parser.prototype.addAstNodeVisitor = function(visitor) { - this._visitor.addAstNodeVisitor(visitor); -}; - -// TODO: docs -Parser.prototype.getAstNodeVisitors = function() { - return this._visitor.getAstNodeVisitors(); -}; - -// TODO: docs -function pretreat(code) { - return code - // comment out hashbang at the top of the file, like: #!/usr/bin/env node - .replace(/^(\#\![\S \t]+\r?\n)/, '// $1') - - // to support code minifiers that preserve /*! comments, treat /*!* as equivalent to /** - .replace(/\/\*\!\*/g, '/**') - // merge adjacent doclets - .replace(/\*\/\/\*\*+/g, '@also'); -} - -/** @private */ -Parser.prototype._parseSourceCode = function(sourceCode, sourceName) { - var ast; - var globalScope; - - var e = { - filename: sourceName - }; - - this.emit('fileBegin', e); - logger.printInfo('Parsing %s ...', sourceName); - - if (!e.defaultPrevented) { - e = { - filename: sourceName, - source: sourceCode - }; - this.emit('beforeParse', e); - sourceCode = e.source; - sourceName = e.filename; - - sourceCode = pretreat(e.source); - - ast = this._astBuilder.build(sourceCode, sourceName); - if (ast) { - this._walker.recurse(sourceName, ast, this._visitor); - } - - } - - this.emit('fileComplete', e); - logger.info('complete.'); -}; - -// TODO: docs -Parser.prototype.addDocletRef = function(e) { - var node; - - if (e && e.code && e.code.node) { - node = e.code.node; - // allow lookup from value => doclet - if (e.doclet) { - this.refs[node.nodeId] = e.doclet; - } - // keep references to undocumented anonymous functions, too, as they might have scoped vars - else if ( - (node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression) && - !this.refs[node.nodeId] ) { - this.refs[node.nodeId] = { - longname: jsdoc.name.ANONYMOUS_LONGNAME, - meta: { - code: e.code - } - }; - } - } -}; - -// TODO: docs -Parser.prototype._getDoclet = function(id) { - if ( hasOwnProp.call(this.refs, id) ) { - return this.refs[id]; - } - - return null; -}; - -// TODO: docs -/** - * @param {string} name - The symbol's longname. - * @return {string} The symbol's basename. - */ -Parser.prototype.getBasename = function(name) { - if (name !== undefined) { - return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1'); - } -}; - -// TODO: docs -function definedInScope(doclet, basename) { - return !!doclet && !!doclet.meta && !!doclet.meta.vars && !!basename && - hasOwnProp.call(doclet.meta.vars, basename); -} - -// TODO: docs -/** - * Given a node, determine what the node is a member of. - * @param {node} node - * @returns {string} The long name of the node that this is a member of. - */ -Parser.prototype.astnodeToMemberof = function(node) { - var basename; - var doclet; - var scope; - - var result = ''; - var type = node.type; - - if ( (type === Syntax.FunctionDeclaration || type === Syntax.FunctionExpression || - type === Syntax.VariableDeclarator) && node.enclosingScope ) { - doclet = this._getDoclet(node.enclosingScope.nodeId); - - if (!doclet) { - result = jsdoc.name.ANONYMOUS_LONGNAME + jsdoc.name.INNER; - } - else { - result = (doclet.longname || doclet.name) + jsdoc.name.INNER; - } - } - else { - // check local references for aliases - scope = node; - basename = this.getBasename( jsdoc.src.astnode.nodeToString(node) ); - - // walk up the scope chain until we find the scope in which the node is defined - while (scope.enclosingScope) { - doclet = this._getDoclet(scope.enclosingScope.nodeId); - if ( doclet && definedInScope(doclet, basename) ) { - result = [doclet.meta.vars[basename], basename]; - break; - } - else { - // move up - scope = scope.enclosingScope; - } - } - - // do we know that it's a global? - doclet = this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID]; - if ( doclet && definedInScope(doclet, basename) ) { - result = [doclet.meta.vars[basename], basename]; - } - - // have we seen the node's parent? if so, use that - else if (node.parent) { - doclet = this._getDoclet(node.parent.nodeId); - - // set the result if we found a doclet. (if we didn't, the AST node may describe a - // global symbol.) - if (doclet) { - result = doclet.longname || doclet.name; - } - } - } - - return result; -}; - -// TODO: docs -/** - * Resolve what "this" refers to relative to a node. - * @param {node} node - The "this" node - * @returns {string} The longname of the enclosing node. - */ -Parser.prototype.resolveThis = function(node) { - var doclet; - 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. - if (node.type !== Syntax.Property && node.enclosingScope) { - doclet = this._getDoclet(node.enclosingScope.nodeId); - - if (!doclet) { - result = jsdoc.name.ANONYMOUS_LONGNAME; // TODO handle global this? - } - else if (doclet['this']) { - result = doclet['this']; - } - // like: Foo.constructor = function(n) { /** blah */ this.name = n; } - else if (doclet.kind === 'function' && doclet.memberof) { - result = doclet.memberof; - } - // like: var foo = function(n) { /** blah */ this.bar = n; } - else if ( doclet.kind === 'member' && jsdoc.src.astnode.isAssignment(node) ) { - result = doclet.longname || doclet.name; - } - // walk up to the closest class we can find - else if (doclet.kind === 'class' || doclet.kind === 'module') { - result = doclet.longname || doclet.name; - } - else if (node.enclosingScope) { - result = this.resolveThis(node.enclosingScope); - } - } - else if (node.parent) { - doclet = this.refs[node.parent.nodeId]; - - // TODO: is this behavior correct? when do we get here? - if (!doclet) { - result = ''; // global? - } - else { - result = doclet.longname || doclet.name; - } - } - // TODO: is this behavior correct? when do we get here? - else { - result = ''; // global? - } - - return result; -}; - -// TODO: docs -/** - * Given 'var foo = { x: 1 }', find foo from x. - */ -Parser.prototype.resolvePropertyParent = function(node) { - var doclet; - - if (node.parent) { - doclet = this._getDoclet(node.parent.nodeId); - } - - return doclet; -}; - -// TODO docs -/** - * Resolve what function a var is limited to. - * @param {astnode} node - * @param {string} basename The leftmost name in the long name: in foo.bar.zip the basename is foo. - */ -Parser.prototype.resolveVar = function(node, basename) { - var doclet; - var result; - - var scope = node.enclosingScope; - - if (!scope) { - result = ''; // global - } - else { - doclet = this._getDoclet(scope.nodeId); - if ( definedInScope(doclet, basename) ) { - result = doclet.longname; - } - else { - result = this.resolveVar(scope, basename); - } - } - - return result; -}; - -// TODO: docs -Parser.prototype.resolveEnum = function(e) { - var doclet = this.resolvePropertyParent(e.code.node.parent); - - if (doclet && doclet.isEnum) { - if (!doclet.properties) { - doclet.properties = []; - } - - // 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 -/** - * 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. - */ diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/scanner.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/scanner.js deleted file mode 100644 index a8170a7..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/scanner.js +++ /dev/null @@ -1,70 +0,0 @@ -/*global env: true */ -/** - @module jsdoc/src/scanner - @requires module:fs - - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var fs = require('jsdoc/fs'); -var logger = require('jsdoc/util/logger'); -var path = require('jsdoc/path'); - -/** - @constructor - @mixes module:events - */ -exports.Scanner = function() {}; -exports.Scanner.prototype = Object.create( require('events').EventEmitter.prototype ); - -/** - Recursively searches the given searchPaths for js files. - @param {Array.} searchPaths - @param {number} [depth=1] - @fires sourceFileFound - */ -exports.Scanner.prototype.scan = function(searchPaths, depth, filter) { - var currentFile; - var isFile; - - var filePaths = []; - var pwd = env.pwd; - var self = this; - - searchPaths = searchPaths || []; - depth = depth || 1; - - searchPaths.forEach(function($) { - var filepath = path.resolve( pwd, decodeURIComponent($) ); - - try { - currentFile = fs.statSync(filepath); - } - catch (e) { - logger.error('Unable to find the source file or directory %s', filepath); - return; - } - - if ( currentFile.isFile() ) { - filePaths.push(filepath); - } - else { - filePaths = filePaths.concat( fs.ls(filepath, depth) ); - } - }); - - filePaths = filePaths.filter(function($) { - return filter.isIncluded($); - }); - - filePaths = filePaths.filter(function($) { - var e = { fileName: $ }; - self.emit('sourceFileFound', e); - - return !e.defaultPrevented; - }); - - return filePaths; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag.js deleted file mode 100644 index 142592a..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag.js +++ /dev/null @@ -1,140 +0,0 @@ -/*global env: true */ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ - -/** - Functionality related to JSDoc tags. - @module jsdoc/tag - @requires jsdoc/tag/dictionary - @requires jsdoc/tag/validator - @requires jsdoc/tag/type - */ -'use strict'; - -var jsdoc = { - tag: { - dictionary: require('jsdoc/tag/dictionary'), - validator: require('jsdoc/tag/validator'), - type: require('jsdoc/tag/type') - }, - util: { - logger: require('jsdoc/util/logger') - } -}; -var path = require('jsdoc/path'); - -function trim(text, opts) { - var indentMatcher; - var match; - - opts = opts || {}; - text = text || ''; - - if (opts.keepsWhitespace) { - text = text.replace(/^[\n\r\f]+|[\n\r\f]+$/g, ''); - if (opts.removesIndent) { - match = text.match(/^([ \t]+)/); - if (match && match[1]) { - indentMatcher = new RegExp('^' + match[1], 'gm'); - text = text.replace(indentMatcher, ''); - } - } - } - else { - text = text.replace(/^\s+|\s+$/g, ''); - } - - return text; -} - -function processTagText(tag, tagDef) { - var tagType; - - if (tagDef.onTagText) { - tag.text = tagDef.onTagText(tag.text); - } - - if (tagDef.canHaveType || tagDef.canHaveName) { - /** The value property represents the result of parsing the tag text. */ - tag.value = {}; - - tagType = jsdoc.tag.type.parse(tag.text, tagDef.canHaveName, tagDef.canHaveType); - - // It is possible for a tag to *not* have a type but still have - // optional or defaultvalue, e.g. '@param [foo]'. - // Although tagType.type.length == 0 we should still copy the other properties. - if (tagType.type) { - if (tagType.type.length) { - tag.value.type = { - names: tagType.type - }; - } - tag.value.optional = tagType.optional; - tag.value.nullable = tagType.nullable; - tag.value.variable = tagType.variable; - tag.value.defaultvalue = tagType.defaultvalue; - } - - if (tagType.text && tagType.text.length) { - tag.value.description = tagType.text; - } - - if (tagDef.canHaveName) { - // note the dash is a special case: as a param name it means "no name" - if (tagType.name && tagType.name !== '-') { tag.value.name = tagType.name; } - } - } - else { - tag.value = tag.text; - } -} - -/** - Constructs a new tag object. Calls the tag validator. - @class - @classdesc Represents a single doclet tag. - @param {string} tagTitle - @param {string=} tagBody - @param {object=} meta - */ -var Tag = exports.Tag = function(tagTitle, tagBody, meta) { - var tagDef; - var trimOpts; - - meta = meta || {}; - - this.originalTitle = trim(tagTitle); - - /** The title part of the tag: @title text */ - this.title = jsdoc.tag.dictionary.normalise(this.originalTitle); - - tagDef = jsdoc.tag.dictionary.lookUp(this.title); - trimOpts = { - keepsWhitespace: tagDef.keepsWhitespace, - removesIndent: tagDef.removesIndent - }; - - /** The text part of the tag: @title text */ - this.text = trim(tagBody, trimOpts); - - 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 - ); - } - } - - jsdoc.tag.validator.validate(this, tagDef, meta); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js deleted file mode 100644 index 0a745b4..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var hasOwnProp = Object.prototype.hasOwnProperty; - -var _tags = {}; -var _tagSynonyms = {}; -var _namespaces = []; -var dictionary; - -/** @private */ -function TagDefinition(title, etc) { - var self = this; - etc = etc || {}; - - this.title = dictionary.normalise(title); - - Object.keys(etc).forEach(function(p) { - self[p] = etc[p]; - }); -} - -/** @private */ -TagDefinition.prototype.synonym = function(synonymName) { - _tagSynonyms[synonymName.toLowerCase()] = this.title; - 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; - - if (opts && opts.isNamespace) { - _namespaces.push(def.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; - } -}; - -require('jsdoc/tag/dictionary/definitions').defineTags(dictionary); - -module.exports = dictionary; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js deleted file mode 100644 index 66a3813..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js +++ /dev/null @@ -1,797 +0,0 @@ -/*global app, env */ -/** - Define tags that are known in JSDoc. - @module jsdoc/tag/dictionary/definitions - - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var hasOwnProp = Object.prototype.hasOwnProperty; -var jsdoc = { - name: require('jsdoc/name'), - src: { - astnode: require('jsdoc/src/astnode') - }, - tag: { - type: require('jsdoc/tag/type') - }, - util: { - 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; - -function getSourcePaths() { - var sourcePaths = env.sourceFiles.slice(0) || []; - - if (env.opts._) { - env.opts._.forEach(function(sourcePath) { - var resolved = path.resolve(env.pwd, sourcePath); - if (sourcePaths.indexOf(resolved) === -1) { - sourcePaths.push(resolved); - } - }); - } - - return sourcePaths; -} - -function filepathMinusPrefix(filepath) { - var sourcePaths = getSourcePaths(); - var commonPrefix = path.commonPrefix(sourcePaths); - var result = ''; - - if (filepath) { - // always use forward slashes - result = (filepath + path.sep).replace(commonPrefix, '') - .replace(/\\/g, '/'); - } - - if (result.length > 0 && result[result.length - 1] !== '/') { - result += '/'; - } - - return result; -} - -/** @private */ -function setDocletKindToTitle(doclet, tag) { - doclet.addTag( 'kind', tag.title ); -} - -function setDocletScopeToTitle(doclet, tag) { - try { - doclet.setScope(tag.title); - } - catch(e) { - jsdoc.util.logger.error(e.message); - } -} - -function setDocletNameToValue(doclet, tag) { - if (tag.value && tag.value.description) { // as in a long tag - doclet.addTag( 'name', tag.value.description); - } - else if (tag.text) { // or a short tag - doclet.addTag('name', tag.text); - } -} - -function setDocletNameToValueName(doclet, tag) { - if (tag.value && tag.value.name) { - doclet.addTag('name', tag.value.name); - } -} - -function setDocletDescriptionToValue(doclet, tag) { - if (tag.value) { - doclet.addTag( 'description', tag.value ); - } -} - -function setDocletTypeToValueType(doclet, tag) { - if (tag.value && tag.value.type) { - // Add the type names and other type properties (such as `optional`). - // Don't overwrite existing properties. - Object.keys(tag.value).forEach(function(prop) { - if ( !hasOwnProp.call(doclet, prop) ) { - doclet[prop] = tag.value[prop]; - } - }); - } -} - -function setNameToFile(doclet, tag) { - var name; - - if (doclet.meta.filename) { - name = filepathMinusPrefix(doclet.meta.path) + doclet.meta.filename; - doclet.addTag('name', name); - } -} - -function setDocletMemberof(doclet, tag) { - if (tag.value && tag.value !== '') { - doclet.setMemberof(tag.value); - } -} - -function applyNamespace(docletOrNs, tag) { - if (typeof docletOrNs === 'string') { // ns - tag.value = app.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); - } -} - -function setDocletNameToFilename(doclet, tag) { - var name = ''; - - if (doclet.meta.path) { - name = filepathMinusPrefix(doclet.meta.path); - } - name += doclet.meta.filename.replace(/\.js$/i, ''); - - doclet.name = name; -} - -function parseBorrows(doclet, tag) { - var m = /^(\S+)(?:\s+as\s+(\S+))?$/.exec(tag.text); - if (m) { - if (m[1] && m[2]) { - return { target: m[1], source: m[2] }; - } - else if (m[1]) { - return { target: m[1] }; - } - } else { - return {}; - } -} - -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', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - // since "abstract" is reserved word in JavaScript let's use "virtual" in code - doclet.virtual = true; - } - }) - .synonym('virtual'); - - dictionary.defineTag('access', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - // only valid values are private and protected, public is default - if ( /^(private|protected)$/i.test(tag.value) ) { - doclet.access = tag.value.toLowerCase(); - } - else { - delete doclet.access; - } - } - }); - - dictionary.defineTag('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. - // *//** - // * Foo with a param. - // * @param {string} bar - // */ - // function foo(bar) {} - dictionary.defineTag('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', { - 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; - }, - onTagged: function(doclet, tag) { - doclet.augment( firstWordOf(tag.value) ); - } - }) - .synonym('extends'); - - dictionary.defineTag('author', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (!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', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - var borrows = parseBorrows(doclet, tag); - doclet.borrow(borrows.target, borrows.source); - } - }); - - dictionary.defineTag('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; - } - } - - setDocletNameToValue(doclet, tag); - } - }) - .synonym('constructor'); - - dictionary.defineTag('classdesc', { - onTagged: function(doclet, tag) { - doclet.classdesc = tag.value; - } - }); - - dictionary.defineTag('constant', { - canHaveType: true, - canHaveName: true, - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - setDocletNameToValueName(doclet, tag); - setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('const'); - - dictionary.defineTag('constructs', { - onTagged: function(doclet, tag) { - var ownerClassName; - if (!tag.value) { - ownerClassName = '{@thisClass}'; // this can be resolved later in the handlers - } - else { - ownerClassName = firstWordOf(tag.value); - } - doclet.addTag('alias', ownerClassName); - doclet.addTag('kind', 'class'); - } - }); - - dictionary.defineTag('copyright', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.copyright = tag.value; - } - }); - - dictionary.defineTag('default', { - onTagged: function(doclet, tag) { - var type; - var value; - - var nodeToString = jsdoc.src.astnode.nodeToString; - - if (tag.value) { - doclet.defaultvalue = tag.value; - } - else if (doclet.meta && doclet.meta.code && doclet.meta.code.value) { - type = doclet.meta.code.type; - value = doclet.meta.code.value; - - switch(type) { - case Syntax.ArrayExpression: - doclet.defaultvalue = nodeToString(doclet.meta.code.node); - doclet.defaultvaluetype = 'array'; - break; - - case Syntax.Literal: - doclet.defaultvalue = String(value); - break; - - case Syntax.ObjectExpression: - doclet.defaultvalue = nodeToString(doclet.meta.code.node); - doclet.defaultvaluetype = 'object'; - break; - - default: - // do nothing - break; - } - } - } - }) - .synonym('defaultvalue'); - - dictionary.defineTag('deprecated', { - // value is optional - onTagged: function(doclet, tag) { - doclet.deprecated = tag.value || true; - } - }); - - dictionary.defineTag('description', { - mustHaveValue: true - }) - .synonym('desc'); - - dictionary.defineTag('enum', { - canHaveType: true, - onTagged: function(doclet, tag) { - doclet.kind = 'member'; - doclet.isEnum = true; - setDocletTypeToValueType(doclet, tag); - } - }); - - dictionary.defineTag('event', { - isNamespace: true, - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); - } - }); - - dictionary.defineTag('example', { - keepsWhitespace: true, - removesIndent: true, - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (!doclet.examples) { doclet.examples = []; } - doclet.examples.push(tag.value); - } - }); - - dictionary.defineTag('exports', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - var modName = firstWordOf(tag.value); - - doclet.addTag('alias', modName); - doclet.addTag('kind', 'module'); - } - }); - - dictionary.defineTag('external', { - canHaveType: true, - isNamespace: true, - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - if (tag.value && tag.value.type) { - setDocletTypeToValueType(doclet, tag); - doclet.addTag('name', doclet.type.names[0]); - } - else { - setDocletNameToValue(doclet, tag); - } - } - }) - .synonym('host'); - - dictionary.defineTag('file', { - onTagged: function(doclet, tag) { - setNameToFile(doclet, tag); - setDocletKindToTitle(doclet, tag); - setDocletDescriptionToValue(doclet, tag); - - doclet.preserveName = true; - } - }) - .synonym('fileoverview') - .synonym('overview'); - - dictionary.defineTag('fires', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (!doclet.fires) { doclet.fires = []; } - applyNamespace('event', tag); - doclet.fires.push(tag.value); - } - }) - .synonym('emits'); - - dictionary.defineTag('function', { - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); - } - }) - .synonym('func') - .synonym('method'); - - dictionary.defineTag('global', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - doclet.scope = 'global'; - delete doclet.memberof; - } - }); - - dictionary.defineTag('ignore', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - doclet.ignore = true; - } - }); - - dictionary.defineTag('inner', { - onTagged: function(doclet, tag) { - setDocletScopeToTitle(doclet, tag); - } - }); - - dictionary.defineTag('instance', { - onTagged: function(doclet, tag) { - setDocletScopeToTitle(doclet, tag); - } - }); - - dictionary.defineTag('kind', { - mustHaveValue: true - }); - - dictionary.defineTag('lends', { - onTagged: function(doclet, tag) { - doclet.alias = tag.value || GLOBAL_LONGNAME; - doclet.addTag('undocumented'); - } - }); - - dictionary.defineTag('license', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.license = tag.value; - } - }); - - dictionary.defineTag('listens', { - mustHaveValue: true, - onTagged: function (doclet, tag) { - if (!doclet.listens) { doclet.listens = []; } - applyNamespace('event', tag); - doclet.listens.push(tag.value); - // TODO: verify that parameters match the event parameters? - } - }); - - dictionary.defineTag('member', { - canHaveType: true, - canHaveName: true, - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - setDocletNameToValueName(doclet, tag); - setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('var'); - - dictionary.defineTag('memberof', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (tag.originalTitle === 'memberof!') { - doclet.forceMemberof = true; - if (tag.value === GLOBAL_LONGNAME) { - doclet.addTag('global'); - delete doclet.memberof; - } - } - setDocletMemberof(doclet, tag); - } - }) - .synonym('memberof!'); - - // this symbol mixes in all of the specified object's members - dictionary.defineTag('mixes', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - var source = firstWordOf(tag.value); - doclet.mix(source); - } - }); - - dictionary.defineTag('mixin', { - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); - } - }); - - dictionary.defineTag('module', { - canHaveType: true, - isNamespace: true, - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); - if (!doclet.name) { - setDocletNameToFilename(doclet, tag); - } - setDocletTypeToValueType(doclet, tag); - } - }); - - dictionary.defineTag('name', { - mustHaveValue: true - }); - - dictionary.defineTag('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 - canHaveType: true, - canHaveName: true, - onTagged: function(doclet, tag) { - if (!doclet.params) { doclet.params = []; } - doclet.params.push(tag.value || {}); - } - }) - .synonym('argument') - .synonym('arg'); - - dictionary.defineTag('private', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - doclet.access = 'private'; - } - }); - - dictionary.defineTag('property', { - mustHaveValue: true, - canHaveType: true, - canHaveName: true, - onTagged: function(doclet, tag) { - if (!doclet.properties) { doclet.properties = []; } - doclet.properties.push(tag.value); - } - }) - .synonym('prop'); - - dictionary.defineTag('protected', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - doclet.access = 'protected'; - } - }); - - dictionary.defineTag('public', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - delete doclet.access; // public is default - } - }); - - // use this instead of old deprecated @final tag - dictionary.defineTag('readonly', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - doclet.readonly = true; - } - }); - - dictionary.defineTag('requires', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - var requiresName; - - // inline link tags are passed through as-is so that `@requires {@link foo}` works - if ( require('jsdoc/tag/inline').isInlineTag(tag.value, 'link\\S*') ) { - requiresName = tag.value; - } - // otherwise, assume it's a module - else { - requiresName = firstWordOf(tag.value); - if (requiresName.indexOf(MODULE_PREFIX) !== 0) { - requiresName = MODULE_PREFIX + requiresName; - } - } - - if (!doclet.requires) { doclet.requires = []; } - doclet.requires.push(requiresName); - } - }); - - dictionary.defineTag('returns', { - mustHaveValue: true, - canHaveType: true, - onTagged: function(doclet, tag) { - if (!doclet.returns) { doclet.returns = []; } - doclet.returns.push(tag.value); - } - }) - .synonym('return'); - - dictionary.defineTag('see', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (!doclet.see) { doclet.see = []; } - doclet.see.push(tag.value); - } - }); - - dictionary.defineTag('since', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.since = tag.value; - } - }); - - dictionary.defineTag('static', { - onTagged: function(doclet, tag) { - setDocletScopeToTitle(doclet, tag); - } - }); - - dictionary.defineTag('summary', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.summary = tag.value; - } - }); - - dictionary.defineTag('this', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet['this'] = firstWordOf(tag.value); - } - }); - - dictionary.defineTag('todo', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (!doclet.todo) { doclet.todo = []; } - doclet.todo.push(tag.value); - } - }); - - dictionary.defineTag('throws', { - mustHaveValue: true, - canHaveType: true, - onTagged: function(doclet, tag) { - if (!doclet.exceptions) { doclet.exceptions = []; } - doclet.exceptions.push(tag.value); - setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('exception'); - - dictionary.defineTag('tutorial', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - if (!doclet.tutorials) { doclet.tutorials = []; } - doclet.tutorials.push(tag.value); - } - }); - - dictionary.defineTag('type', { - mustHaveValue: true, - mustNotHaveDescription: true, - canHaveType: true, - onTagText: function(text) { - var closeIdx; - var openIdx; - - var OPEN_BRACE = '{'; - var CLOSE_BRACE = '}'; - - // remove line breaks - text = text.replace(/[\f\n\r]/g, ''); - - // Text must be a type expression; for backwards compatibility, we add braces if they're - // missing. But do NOT add braces to things like `@type {string} some pointless text`. - openIdx = text.indexOf(OPEN_BRACE); - closeIdx = text.indexOf(CLOSE_BRACE); - - // a type expression is at least one character long - if ( openIdx !== 0 || closeIdx <= openIdx + 1) { - text = OPEN_BRACE + text + CLOSE_BRACE; - } - - return text; - }, - onTagged: function(doclet, tag) { - if (tag.value && tag.value.type) { - setDocletTypeToValueType(doclet, tag); - - // for backwards compatibility, we allow @type for functions to imply return type - if (doclet.kind === 'function') { - doclet.addTag('returns', tag.text); - } - } - } - }); - - dictionary.defineTag('typedef', { - canHaveType: true, - canHaveName: true, - onTagged: function(doclet, tag) { - setDocletKindToTitle(doclet, tag); - - if (tag.value) { - setDocletNameToValueName(doclet, tag); - - // callbacks are always type {function} - if (tag.originalTitle === 'callback') { - doclet.type = { - names: [ - 'function' - ] - }; - } - else { - setDocletTypeToValueType(doclet, tag); - } - } - } - }) - .synonym('callback'); - - dictionary.defineTag('undocumented', { - mustNotHaveValue: true, - onTagged: function(doclet, tag) { - doclet.undocumented = true; - doclet.comment = ''; - } - }); - - dictionary.defineTag('variation', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.variation = tag.value; - } - }); - - dictionary.defineTag('version', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.version = tag.value; - } - }); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/inline.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/inline.js deleted file mode 100644 index e05c40f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/inline.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @module jsdoc/tag/inline - * - * @author Jeff Williams - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -/** - * Information about an inline tag that was found within a string. - * - * @typedef {Object} InlineTagInfo - * @memberof module:jsdoc/tag/inline - * @property {?string} completeTag - The entire inline tag, including its enclosing braces. - * @property {?string} tag - The tag whose text was found. - * @property {?string} text - The tag text that was found. - */ - -/** - * Information about the results of replacing inline tags within a string. - * - * @typedef {Object} InlineTagResult - * @memberof module:jsdoc/tag/inline - * @property {Array.} tags - The inline tags that were found. - * @property {string} newString - The updated text string after extracting or replacing the inline - * tags. - */ - -/** - * Text-replacing function for strings that contain an inline tag. - * - * @callback InlineTagReplacer - * @memberof module:jsdoc/tag/inline - * @param {string} string - The complete string containing the inline tag. - * @param {module:jsdoc/tag/inline.InlineTagInfo} tagInfo - Information about the inline tag. - * @return {string} An updated version of the complete string. - */ - -/** - * Create a regexp that matches a specific inline tag, or all inline tags. - * - * @private - * @memberof module:jsdoc/tag/inline - * @param {?string} tagName - The inline tag that the regexp will match. May contain regexp - * characters. If omitted, matches any string. - * @param {?string} prefix - A prefix for the regexp. Defaults to an empty string. - * @param {?string} suffix - A suffix for the regexp. Defaults to an empty string. - * @returns {RegExp} A regular expression that matches the requested inline tag. - */ -function regExpFactory(tagName, prefix, suffix) { - tagName = tagName || '\\S+'; - prefix = prefix || ''; - suffix = suffix || ''; - - return new RegExp(prefix + '\\{@' + tagName + '\\s+((?:.|\n)+?)\\}' + suffix, 'gi'); -} - -/** - * Check whether a string is an inline tag. You can check for a specific inline tag or for any valid - * inline tag. - * - * @param {string} string - The string to check. - * @param {?string} tagName - The inline tag to match. May contain regexp characters. If this - * parameter is omitted, this method returns `true` for any valid inline tag. - * @returns {boolean} Set to `true` if the string is a valid inline tag or `false` in all other - * cases. - */ -exports.isInlineTag = function(string, tagName) { - return regExpFactory(tagName, '^', '$').test(string); -}; - -/** - * Replace all instances of multiple inline tags with other text. - * - * @param {string} string - The string in which to replace the inline tags. - * @param {Object} replacers - The functions that are used to replace text in the string. The keys - * must contain tag names (for example, `link`), and the values must contain functions with the - * type {@link module:jsdoc/tag/inline.InlineTagReplacer}. - * @return {module:jsdoc/tag/inline.InlineTagResult} The updated string, as well as information - * about the inline tags that were found. - */ -exports.replaceInlineTags = function(string, replacers) { - var tagInfo = []; - - function replaceMatch(replacer, tag, match, text) { - var matchedTag = { - completeTag: match, - tag: tag, - text: text - }; - tagInfo.push(matchedTag); - - return replacer(string, matchedTag); - } - - string = string || ''; - Object.keys(replacers).forEach(function(replacer) { - var tagRegExp = regExpFactory(replacer); - var matches; - // call the replacer once for each match - while ( (matches = tagRegExp.exec(string)) !== null ) { - string = replaceMatch(replacers[replacer], replacer, matches[0], matches[1]); - } - }); - - return { - tags: tagInfo, - newString: string.trim() - }; -}; - -/** - * Replace all instances of an inline tag with other text. - * - * @param {string} string - The string in which to replace the inline tag. - * @param {string} tag - The name of the inline tag to replace. - * @param {module:jsdoc/tag/inline.InlineTagReplacer} replacer - The function that is used to - * replace text in the string. - * @return {module:jsdoc/tag/inline.InlineTagResult} The updated string, as well as information - * about the inline tags that were found. - */ -exports.replaceInlineTag = function(string, tag, replacer) { - var replacers = {}; - replacers[tag] = replacer; - - return exports.replaceInlineTags(string, replacers); -}; - -/** - * Extract inline tags from a string, replacing them with an empty string. - * - * @param {string} string - The string from which to extract text. - * @param {?string} tag - The inline tag to extract. - * @return {module:jsdoc/tag/inline.InlineTagResult} The updated string, as well as information - * about the inline tags that were found. - */ -exports.extractInlineTag = function(string, tag) { - return exports.replaceInlineTag(string, tag, function(str, tagInfo) { - return str.replace(tagInfo.completeTag, ''); - }); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/type.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/type.js deleted file mode 100644 index b0ca81f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/type.js +++ /dev/null @@ -1,303 +0,0 @@ -/** - * @module jsdoc/tag/type - * - * @author Michael Mathews - * @author Jeff Williams - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var catharsis = require('catharsis'); -var jsdoc = { - name: require('jsdoc/name'), - tag: { - inline: require('jsdoc/tag/inline') - } -}; -var util = require('util'); - -/** - * Information about a type expression extracted from tag text. - * - * @typedef TypeExpressionInfo - * @memberof module:jsdoc/tag/type - * @property {string} expression - The type expression. - * @property {string} text - The updated tag text. - */ - -/** @private */ -function unescapeBraces(text) { - return text.replace(/\\\{/g, '{') - .replace(/\\\}/g, '}'); -} - -/** - * Extract a type expression from the tag text. - * - * @private - * @param {string} string - The tag text. - * @return {module:jsdoc/tag/type.TypeExpressionInfo} The type expression and updated tag text. - */ - function extractTypeExpression(string) { - var completeExpression; - var count = 0; - var position = 0; - var expression = ''; - var startIndex = string.search(/\{[^@]/); - var textStartIndex; - - if (startIndex !== -1) { - // advance to the first character in the type expression - position = textStartIndex = startIndex + 1; - count++; - - while (position < string.length) { - switch (string[position]) { - case '\\': - // backslash is an escape character, so skip the next character - position++; - break; - case '{': - count++; - break; - case '}': - count--; - break; - default: - // do nothing - } - - if (count === 0) { - completeExpression = string.slice(startIndex, position + 1); - expression = string.slice(textStartIndex, position).trim(); - break; - } - - position++; - } - } - - string = completeExpression ? string.replace(completeExpression, '') : string; - - return { - expression: unescapeBraces(expression), - newString: string.trim() - }; -} - -/** @private */ -function getTagInfo(tagValue, canHaveName, canHaveType) { - var name = ''; - var typeExpression = ''; - var text = tagValue; - var expressionAndText; - var nameAndDescription; - var typeOverride; - - if (canHaveType) { - expressionAndText = extractTypeExpression(text); - typeExpression = expressionAndText.expression; - text = expressionAndText.newString; - } - - if (canHaveName) { - nameAndDescription = jsdoc.name.splitName(text); - name = nameAndDescription.name; - text = nameAndDescription.description; - } - - // an inline @type tag, like {@type Foo}, overrides the type expression - if (canHaveType) { - typeOverride = jsdoc.tag.inline.extractInlineTag(text, 'type'); - if (typeOverride.tags && typeOverride.tags[0]) { - typeExpression = typeOverride.tags[0].text; - } - text = typeOverride.newString; - } - - return { - name: name, - typeExpression: typeExpression, - text: text - }; -} - -/** - * Information provided in a JSDoc tag. - * - * @typedef {Object} TagInfo - * @memberof module:jsdoc/tag/type - * @property {string} TagInfo.defaultvalue - The default value of the member. - * @property {string} TagInfo.name - The name of the member (for example, `myParamName`). - * @property {boolean} TagInfo.nullable - Indicates whether the member can be set to `null` or - * `undefined`. - * @property {boolean} TagInfo.optional - Indicates whether the member is optional. - * @property {string} TagInfo.text - Descriptive text for the member (for example, `The user's email - * address.`). - * @property {Array.} TagInfo.type - The type or types that the member can contain (for - * example, `string` or `MyNamespace.MyClass`). - * @property {string} TagInfo.typeExpression - The type expression that was parsed to identify the - * types. - * @property {boolean} TagInfo.variable - Indicates whether the number of members that are provided - * can vary (for example, in a function that accepts any number of parameters). - */ - -// TODO: move to module:jsdoc/name? -/** - * Extract JSDoc-style type information from the name specified in the tag info, including the - * member name; whether the member is optional; and the default value of the member. - * - * @private - * @param {module:jsdoc/tag/type.TagInfo} tagInfo - Information contained in the tag. - * @return {module:jsdoc/tag/type.TagInfo} Updated information from the tag. - */ -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; - - // like 'foo=bar' or 'foo = bar' - if ( /^(.+?)\s*=\s*(.+)$/.test(tagInfo.name) ) { - tagInfo.name = RegExp.$1; - tagInfo.defaultvalue = RegExp.$2; - } - } - - return tagInfo; -} - -/** @private */ -function getTypeStrings(parsedType, isOutermostType) { - var applications; - var typeString; - - var types = []; - - var TYPES = catharsis.Types; - - switch(parsedType.type) { - case TYPES.AllLiteral: - types.push('*'); - break; - case TYPES.FunctionType: - types.push('function'); - break; - case TYPES.NameExpression: - types.push(parsedType.name); - break; - case TYPES.NullLiteral: - types.push('null'); - break; - case TYPES.RecordType: - types.push('Object'); - break; - case TYPES.TypeApplication: - // 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); - }).join(', '); - typeString = util.format( '%s.<%s>', getTypeStrings(parsedType.expression), - applications ); - - types.push(typeString); - } - else { - types.push( catharsis.stringify(parsedType) ); - } - break; - case TYPES.TypeUnion: - parsedType.elements.forEach(function(element) { - types = types.concat( getTypeStrings(element) ); - }); - break; - case TYPES.UndefinedLiteral: - types.push('undefined'); - break; - case TYPES.UnknownLiteral: - types.push('?'); - break; - default: - // this shouldn't happen - throw new Error( util.format('unrecognized type %s in parsed type: %j', parsedType.type, - parsedType) ); - } - - return types; -} - -/** - * Extract JSDoc-style and Closure Compiler-style type information from the type expression - * specified in the tag info. - * - * @private - * @param {module:jsdoc/tag/type.TagInfo} tagInfo - Information contained in the tag. - * @return {module:jsdoc/tag/type.TagInfo} Updated information from the tag. - */ -function parseTypeExpression(tagInfo) { - var errorMessage; - var parsedType; - - // don't try to parse empty type expressions - if (!tagInfo.typeExpression) { - return tagInfo; - } - - try { - parsedType = catharsis.parse(tagInfo.typeExpression, {jsdoc: true}); - } - catch (e) { - // always re-throw so the caller has a chance to report which file was bad - throw new Error( util.format('Invalid type expression "%s": %s', tagInfo.typeExpression, - e.message) ); - } - - tagInfo.type = tagInfo.type.concat( getTypeStrings(parsedType, true) ); - - // Catharsis and JSDoc use the same names for 'optional' and 'nullable'... - ['optional', 'nullable'].forEach(function(key) { - if (parsedType[key] !== null && parsedType[key] !== undefined) { - tagInfo[key] = parsedType[key]; - } - }); - - // ...but not 'variable'. - if (parsedType.repeatable !== null && parsedType.repeatable !== undefined) { - tagInfo.variable = parsedType.repeatable; - } - - return tagInfo; -} - -// TODO: allow users to add/remove type parsers (perhaps via plugins) -var typeParsers = [parseName, parseTypeExpression]; - -/** - * Parse the value of a JSDoc tag. - * - * @param {string} tagValue - The value of the tag. For example, the tag `@param {string} name` has - * a value of `{string} name`. - * @param {boolean} canHaveName - Indicates whether the value can include a symbol name. - * @param {boolean} canHaveType - Indicates whether the value can include a type expression that - * describes the symbol. - * @return {module:jsdoc/tag/type.TagInfo} Information obtained from the tag. - * @throws {Error} Thrown if a type expression cannot be parsed. - */ -exports.parse = function(tagValue, canHaveName, canHaveType) { - if (typeof tagValue !== 'string') { tagValue = ''; } - - var tagInfo = getTagInfo(tagValue, canHaveName, canHaveType); - tagInfo.type = tagInfo.type || []; - - typeParsers.forEach(function(parser) { - tagInfo = parser.call(this, tagInfo); - }); - - // if we wanted a type, but the parsers didn't add any type names, use the type expression - if (canHaveType && !tagInfo.type.length && tagInfo.typeExpression) { - tagInfo.type = [tagInfo.typeExpression]; - } - - return tagInfo; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/validator.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/validator.js deleted file mode 100644 index 3d9103c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tag/validator.js +++ /dev/null @@ -1,45 +0,0 @@ -/*global env: true */ -/** - @module jsdoc/tag/validator - @requires jsdoc/tag/dictionary - - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var dictionary = require('jsdoc/tag/dictionary'); -var format = require('util').format; -var logger = require('jsdoc/util/logger'); - -function buildMessage(tagName, meta, desc) { - var result = format('The @%s tag %s. File: %s, line: %s', tagName, desc, meta.filename, - meta.lineno); - if (meta.comment) { - result += '\n' + meta.comment; - } - return result; -} - -/** - * Validate the given tag. - */ -exports.validate = function(tag, tagDef, meta) { - // 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') ); - } - else if (!tag.text && tagDef.mustHaveValue) { - logger.error( buildMessage(tag.title, meta, 'requires a value') ); - } - - // check for minor issues that are usually harmless - else if (tag.text && tagDef.mustNotHaveValue) { - logger.warn( buildMessage(tag.title, meta, - 'does not permit a value; the value will be ignored') ); - } - else if (tag.value && tag.value.description && tagDef.mustNotHaveDescription) { - logger.warn( buildMessage(tag.title, meta, - 'does not permit a description; the description will be ignored') ); - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/template.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/template.js deleted file mode 100644 index b5317c9..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/template.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file Wrapper for underscore's template utility to allow loading templates from files. - * @author Rafał Wrzeszcz - * @author Matthew Christopher Kastor-Inare III - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var _ = require('underscore'), - fs = require('jsdoc/fs'), - path = require('path'); - -/** - @module jsdoc/template - */ - -/** - @class - @classdesc Underscore template helper. - @param {string} path - Templates directory. - */ -exports.Template = function(path) { - this.path = path; - this.layout = null; - this.cache = {}; - // override default template tag settings - this.settings = { - evaluate : /<\?js([\s\S]+?)\?>/g, - interpolate: /<\?js=([\s\S]+?)\?>/g, - escape : /<\?js~([\s\S]+?)\?>/g - }; - -}; - -/** Loads template from given file. - @param {string} file - Template filename. - @return {function} Returns template closure. - */ -exports.Template.prototype.load = function(file) { - return _.template(fs.readFileSync(file, 'utf8'), null, this.settings); -}; - -/** - Renders template using given data. - - This is low-level function, for rendering full templates use {@link Template.render()}. - - @param {string} file - Template filename. - @param {object} data - Template variables (doesn't have to be object, but passing variables dictionary is best way and most common use). - @return {string} Rendered template. - */ -exports.Template.prototype.partial = function(file, data) { - file = path.resolve(this.path, file); - - // load template into cache - if (!(file in this.cache)) { - this.cache[file] = this.load(file); - } - - // keep template helper context - return this.cache[file].call(this, data); -}; - -/** - Renders template with given data. - - This method automaticaly applies layout if set. - - @param {string} file - Template filename. - @param {object} data - Template variables (doesn't have to be object, but passing variables dictionary is best way and most common use). - @return {string} Rendered template. - */ -exports.Template.prototype.render = function(file, data) { - // main content - var content = this.partial(file, data); - - // apply layout - if (this.layout) { - data.content = content; - content = this.partial(this.layout, data); - } - - return content; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tutorial.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tutorial.js deleted file mode 100644 index a20b9c7..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tutorial.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - @overview - @author Rafał Wrzeszcz - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var markdown = require('jsdoc/util/markdown'); - -/** Removes child tutorial from the parent. Does *not* unset child.parent though. - @param {Tutorial} parent - parent tutorial. - @param {Tutorial} child - Old child. - @private - */ -function removeChild(parent, child) { - var index = parent.children.indexOf(child); - if (index !== -1) { - parent.children.splice(index, 1); - } -} - -/** Adds a child to the parent tutorial. Does *not* set child.parent though. - @param {Tutorial} parent - parent tutorial. - @param {Tutorial} child - New child. - @private - */ -function addChild(parent, child) { - parent.children.push(child); -} - -/** - @module jsdoc/tutorial - */ - -/** - @class - @classdesc Represents a single JSDoc tutorial. - @param {string} name - Tutorial name. - @param {string} content - Text content. - @param {number} type - Source formating. - */ -exports.Tutorial = function(name, content, type) { - this.title = this.name = name; - this.content = content; - this.type = type; - - // default values - this.parent = null; - this.children = []; -}; - -/** Moves children from current parent to different one. - @param {?Tutorial} parent - New parent. If null, the tutorial has no parent. - */ -exports.Tutorial.prototype.setParent = function(parent) { - // removes node from old parent - if (this.parent) { - removeChild(this.parent, this); - } - - this.parent = parent; - if (parent) { - addChild(parent, this); - } -}; - -/** Removes children from current node. - @param {Tutorial} child - Old child. - */ -exports.Tutorial.prototype.removeChild = function(child) { - child.setParent(null); -}; - -/** Adds new children to current node. - @param {Tutorial} child - New child. - */ -exports.Tutorial.prototype.addChild = function(child) { - child.setParent(this); -}; - -/** Prepares source. - @return {string} HTML source. - */ -exports.Tutorial.prototype.parse = function() { - switch (this.type) { - // nothing to do - case exports.TYPES.HTML: - return this.content; - - // markdown - case exports.TYPES.MARKDOWN: - var mdParse = markdown.getParser(); - return mdParse(this.content) - .replace(/&/g, '&') // because markdown escapes these - .replace(/</g, '<') - .replace(/>/g, '>'); - - // uhm... should we react somehow? - // if not then this case can be merged with TYPES.HTML - default: - return this.content; - } -}; - -/** Tutorial source types. - @enum {number} - */ -exports.TYPES = { - HTML: 1, - MARKDOWN: 2 -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js deleted file mode 100644 index 7c446e2..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js +++ /dev/null @@ -1,193 +0,0 @@ -/*global env: true */ -/** - @overview - @author Rafał Wrzeszcz - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ - -/** - @module jsdoc/tutorial/resolver - */ -'use strict'; - -var logger = require('jsdoc/util/logger'); -var fs = require('jsdoc/fs'); -var path = require('path'); -var tutorial = require('jsdoc/tutorial'); - -var hasOwnProp = Object.prototype.hasOwnProperty; - -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'. - * @param {object} json - the object we want to test (typically from JSON.parse) - * @returns {boolean} whether `json` could be the metadata for a tutorial. - */ -function isTutorialJSON(json) { - // if conf.title exists or conf.children exists, it is metadata for a tutorial - return (hasOwnProp.call(json, 'title') || hasOwnProp.call(json, 'children')); -} - -/** 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 - * opposed to an array of tutorial names. - * - * Recurses as necessary to ensure all tutorials are added. - * - * @param {string} name - if `meta` is a configuration for a single tutorial, - * this is that tutorial's name. - * @param {object} meta - object that contains tutorial information. - * Can either be for a single tutorial, or for multiple - * (where each key in `meta` is the tutorial name and each - * value is the information for a single tutorial). - * Additionally, a tutorial's 'children' property may - * either be an array of strings (names of the child tutorials), - * OR an object giving the configuration for the child tutorials. - */ -function addTutorialConf(name, meta) { - var names, i; - 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) { - addTutorialConf(names[i], meta.children[names[i]]); - } - // replace with an array of names. - meta.children = names; - } - // check if the tutorial has already been defined... - if (hasOwnProp.call(conf, name)) { - logger.warn('Metadata for the tutorial %s is defined more than once. Only the first definition will be used.', name ); - } else { - conf[name] = meta; - } - } else { - // it's an object of tutorials, the keys are th etutorial names. - names = Object.keys(meta); - for (i = 0; i < names.length; ++i) { - addTutorialConf(names[i], meta[names[i]]); - } - } -} - -/** Adds new tutorial. - @param {tutorial.Tutorial} current - New tutorial. - */ -exports.addTutorial = function(current) { - if (hasOwnProp.call(tutorials, 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 - current.setParent(exports.root); - } -}; - -/** Root tutorial. - @type tutorial.Tutorial - */ -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); - - // tutorials handling - files.forEach(function(file) { - match = file.match(finder); - - // any filetype that can apply to tutorials - if (match) { - name = path.basename(match[1]); - content = fs.readFileSync(file, env.opts.encoding); - - switch (match[2].toLowerCase()) { - // HTML type - case 'xml': - case 'xhtml': - case 'html': - case 'htm': - type = tutorial.TYPES.HTML; - break; - - // Markdown typs - case 'md': - case 'markdown': - type = tutorial.TYPES.MARKDOWN; - break; - - // configuration file - case 'json': - var meta = JSON.parse(content); - addTutorialConf(name, meta); - // don't add this as a tutorial - return; - - // how can it be? check `finder' regexp - default: - // not a file we want to work with - return; - } - - current = new tutorial.Tutorial(name, content, type); - exports.addTutorial(current); - } - }); -}; - -/** 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; - } - - item = conf[name]; - current = tutorials[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); - } - }); - } - } - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/doop.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/doop.js deleted file mode 100644 index a9e1468..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/doop.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - Deep clone a simple object. - @private - */ -'use strict'; - -function doop(o) { - var clone; - var props; - var i; - var l; - - 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]; - } - } - 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])); - } - } - - return clone; - } - - return o; -} - -// for backwards compatibility -doop.doop = doop; - -module.exports = doop; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/dumper.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/dumper.js deleted file mode 100644 index 3d9c667..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/dumper.js +++ /dev/null @@ -1,135 +0,0 @@ -/*global Set */ -/** - * Recursively print out all names and values in a data structure. - * @module jsdoc/util/dumper - * @author Michael Mathews - * @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ -'use strict'; - -var util = require('util'); -var setDefined = typeof Set !== 'undefined'; - -function ObjectWalker() { - if (setDefined) { - this.seenItems = new Set(); - } else { - this.seenItems = []; - } -} - -ObjectWalker.prototype.seen = function(object) { - var result; - if (setDefined) { - result = this.seenItems.has(object); - } else { - result = object.hasBeenSeenByWalkerDumper; - } - return result; -}; - -ObjectWalker.prototype.markAsSeen = function(object) { - if (setDefined) { - this.seenItems.add(object); - } else { - object.hasBeenSeenByWalkerDumper = true; - this.seenItems.push(object); - } -}; - -ObjectWalker.prototype.cleanSeenFlag = function() { - if (setDefined) { - this.seenItems = new Set(); - } else { - this.seenItems.forEach(function(object) { - delete object.hasBeenSeenByWalkerDumper; - }); - } -}; - -// some objects are unwalkable, like Java native objects -ObjectWalker.prototype.isUnwalkable = function(o) { - return (o && typeof o === 'object' && typeof o.constructor === 'undefined'); -}; - -ObjectWalker.prototype.isFunction = function(o) { - return (o && typeof o === 'function' || o instanceof Function); -}; - -ObjectWalker.prototype.isObject = function(o) { - return o && o instanceof Object || - (o && typeof o.constructor !== 'undefined' && o.constructor.name === 'Object'); -}; - -ObjectWalker.prototype.checkCircularRefs = function(o, func) { - if ( this.seen(o) ) { - return ''; - } - else { - this.markAsSeen(o); - return func(o); - } -}; - -ObjectWalker.prototype.walk = function(o) { - var result; - - var self = this; - - if ( this.isUnwalkable(o) ) { - result = ''; - } - else if ( o === undefined ) { - result = null; - } - else if ( Array.isArray(o) ) { - result = this.checkCircularRefs(o, function(arr) { - var newArray = []; - arr.forEach(function(item) { - newArray.push( self.walk(item) ); - }); - - return newArray; - }); - } - else if ( util.isRegExp(o) ) { - result = ''; - } - else if ( util.isDate(o) ) { - result = ''; - } - else if ( util.isError(o) ) { - result = { message: o.message }; - } - else if ( this.isFunction(o) ) { - result = ''; - } - 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; } - newObj[key] = self.walk(obj[key]); - }); - - return newObj; - }); - } - // should be safe to JSON.stringify() everything else - else { - result = o; - } - - return result; -}; - -/** - * @param {*} object - */ -exports.dump = function(object) { - var walker = new ObjectWalker(); - var result = JSON.stringify(walker.walk(object), null, 4); - walker.cleanSeenFlag(); - - return result; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/error.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/error.js deleted file mode 100644 index 6ed1895..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/error.js +++ /dev/null @@ -1,35 +0,0 @@ -/*global env: true */ -/** - * Helper functions for handling errors. - * - * @deprecated As of JSDoc 3.3.0. This module may be removed in a future release. Use the module - * {@link module:jsdoc/util/logger} to log warnings and errors. - * @module jsdoc/util/error - */ -'use strict'; - -/** - * Log an exception as an error. - * - * Prior to JSDoc 3.3.0, this method would either log the exception (if lenient mode was enabled) or - * re-throw the exception (default). - * - * In JSDoc 3.3.0 and later, lenient mode has been replaced with strict mode, which is disabled by - * default. If strict mode is enabled, calling the `handle` method causes JSDoc to exit immediately, - * just as if the exception had been re-thrown. - * - * @deprecated As of JSDoc 3.3.0. This module may be removed in a future release. - * @param {Error} e - The exception to log. - * @memberof module:jsdoc/util/error - */ -exports.handle = function(e) { - var logger = require('jsdoc/util/logger'); - var msg = e ? ( e.message || JSON.stringify(e) ) : ''; - - // include the error type if it's an Error object - if (e instanceof Error) { - msg = e.name + ': ' + msg; - } - - logger.error(msg); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/markdown.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/markdown.js deleted file mode 100644 index 4f2e198..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/markdown.js +++ /dev/null @@ -1,156 +0,0 @@ -/*global env */ - -/** - * Provides access to Markdown-related functions. - * @module jsdoc/util/markdown - * @author Michael Mathews - * @author Ben Blank - */ -'use strict'; - -var util = require('util'); - -/** - * Enumeration of Markdown parsers that are available. - * @enum {String} - */ -var parserNames = { - /** - * The "[markdown-js](https://github.com/evilstreak/markdown-js)" (aka "evilstreak") parser. - * - * @deprecated Replaced by "marked," as markdown-js does not support inline HTML. - */ - evilstreak: 'marked', - /** - * The "GitHub-flavored Markdown" parser. - * @deprecated Replaced by "marked." - */ - gfm: 'marked', - /** - * The "[Marked](https://github.com/chjj/marked)" parser. - */ - marked: 'marked' -}; - -/** - * Escape underscores that occur within {@ ... } in order to protect them - * from the markdown parser(s). - * @param {String} source the source text to sanitize. - * @returns {String} `source` where underscores within {@ ... } have been - * protected with a preceding backslash (i.e. \_) -- the markdown parsers - * will strip the backslash and protect the underscore. - */ -function escapeUnderscores(source) { - return source.replace(/\{@[^}\r\n]+\}/g, function (wholeMatch) { - return wholeMatch.replace(/(^|[^\\])_/g, '$1\\_'); - }); -} - -/** - * Escape HTTP/HTTPS URLs so that they are not automatically converted to HTML links. - * - * @param {string} source - The source text to escape. - * @return {string} The source text with escape characters added to HTTP/HTTPS URLs. - */ -function escapeUrls(source) { - return source.replace(/(https?)\:\/\//g, '$1:\\/\\/'); -} - -/** - * Unescape HTTP/HTTPS URLs after Markdown parsing is complete. - * - * @param {string} source - The source text to unescape. - * @return {string} The source text with escape characters removed from HTTP/HTTPS URLs. - */ -function unescapeUrls(source) { - return source.replace(/(https?)\:\\\/\\\//g, '$1://'); -} - -/** - * Escape characters in text within a code block. - * - * @param {string} source - The source text to escape. - * @return {string} The escaped source text. - */ -function escapeCode(source) { - return source.replace(/%s', level, text, level); - }; - - // Allow prettyprint to work on inline code samples - markedRenderer.code = function(code, language) { - var langClass = language ? ' lang-' + language : ''; - - return util.format( '
%s
', - langClass, escapeCode(code) ); - }; - - parserFunction = function(source) { - var result; - - source = escapeUnderscores(source); - source = escapeUrls(source); - - result = marked(source, { renderer: markedRenderer }) - .replace(/\s+$/, '') - .replace(/'/g, "'"); - result = unescapeUrls(result); - - return result; - }; - parserFunction._parser = parserNames.marked; - return parserFunction; - } - else { - logger.error('Unrecognized Markdown parser "%s". Markdown support is disabled.', - parserName); - } -} - -/** - * Retrieve a Markdown parsing function based on the value of the `conf.json` file's - * `env.conf.markdown` property. The parsing function accepts a single parameter containing Markdown - * source. The function uses the parser specified in `conf.json` to transform the Markdown source to - * HTML, then returns the HTML as a string. - * - * @returns {function} A function that accepts Markdown source, feeds it to the selected parser, and - * returns the resulting HTML. - */ -exports.getParser = function() { - var conf = env.conf.markdown; - if (conf && conf.parser) { - return getParseFunction(parserNames[conf.parser], conf); - } - else { - // marked is the default parser - return getParseFunction(parserNames.marked, conf); - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js deleted file mode 100644 index 709cd2f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js +++ /dev/null @@ -1,767 +0,0 @@ -/*global env: true */ -/** - * @module jsdoc/util/templateHelper - */ -'use strict'; - -var dictionary = require('jsdoc/tag/dictionary'); -var util = require('util'); - -var hasOwnProp = Object.prototype.hasOwnProperty; - -var files = {}; - -// each container gets its own html file -var containers = ['class', 'module', 'external', 'namespace', 'mixin']; - -var tutorials; - -/** Sets tutorials map. - @param {jsdoc.tutorial.Tutorial} root - Root tutorial node. - */ -exports.setTutorials = function(root) { - tutorials = root; -}; - -exports.globalName = 'global'; -exports.fileExtension = '.html'; -exports.scopeToPunc = require('jsdoc/name').scopeToPunc; - -function getNamespace(kind) { - if (dictionary.isNamespace(kind)) { - return kind + ':'; - } - return ''; -} - -function makeFilenameUnique(filename, str) { - var key = filename.toLowerCase(); - var nonUnique = true; - - // append enough underscores to make the filename unique - while (nonUnique) { - if ( files[key] && hasOwnProp.call(files, key) ) { - filename += '_'; - key = filename.toLowerCase(); - } else { - nonUnique = false; - } - } - - files[key] = 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(/ 0; -} - -/** - * Build an HTML link to the symbol with the specified longname. If the longname is not - * associated with a URL, this method simply returns the link text, if provided, or the longname. - * - * The `longname` parameter can also contain a URL rather than a symbol's longname. - * - * This method supports type applications that can contain one or more types, such as - * `Array.` or `Array.<(MyClass|YourClass)>`. In these examples, the method attempts to - * replace `Array`, `MyClass`, and `YourClass` with links to the appropriate types. The link text - * is ignored for type applications. - * - * @param {string} longname - The longname (or URL) that is the target of the link. - * @param {string=} linkText - The text to display for the link, or `longname` if no text is - * provided. - * @param {Object} options - Options for building the link. - * @param {string=} options.cssClass - The CSS class (or classes) to include in the link's `` - * tag. - * @param {string=} options.fragmentId - The fragment identifier (for example, `name` in - * `foo.html#name`) to append to the link target. - * @param {string=} options.linkMap - The link map in which to look up the longname. - * @param {boolean=} options.monospace - Indicates whether to display the link text in a monospace - * font. - * @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 stripped; - var text; - var url; - var parsedType; - - // handle cases like: - // @see - // @see http://example.org - stripped = longname ? longname.replace(/^<|>$/g, '') : ''; - if ( hasUrlPrefix(stripped) ) { - url = stripped; - text = linkText || stripped; - } - // handle complex type expressions that may require multiple links - // (but skip anything that looks like an inline tag) - else if (longname && isComplexTypeExpression(longname) && /\{\@.+\}/.test(longname) === false) { - parsedType = parseType(longname); - return stringifyType(parsedType, options.cssClass, options.linkMap); - } - else { - url = hasOwnProp.call(options.linkMap, longname) ? options.linkMap[longname] : ''; - text = linkText || longname; - } - - text = options.monospace ? '' + text + '' : text; - - if (!url) { - return text; - } - else { - return util.format('%s', url, fragmentString, classString, text); - } -} - -/** - * Retrieve an HTML link to the symbol with the specified longname. If the longname is not - * associated with a URL, this method simply returns the link text, if provided, or the longname. - * - * The `longname` parameter can also contain a URL rather than a symbol's longname. - * - * This method supports type applications that can contain one or more types, such as - * `Array.` or `Array.<(MyClass|YourClass)>`. In these examples, the method attempts to - * replace `Array`, `MyClass`, and `YourClass` with links to the appropriate types. The link text - * is ignored for type applications. - * - * @param {string} longname - The longname (or URL) that is the target of the link. - * @param {string=} linkText - The text to display for the link, or `longname` if no text is - * provided. - * @param {string=} cssClass - The CSS class (or classes) to include in the link's `` tag. - * @param {string=} fragmentId - The fragment identifier (for example, `name` in `foo.html#name`) to - * append to the link target. - * @return {string} The HTML link, or a plain-text string if the link is not available. - */ -var linkto = exports.linkto = function(longname, linkText, cssClass, fragmentId) { - return buildLink(longname, linkText, { - cssClass: cssClass, - fragmentId: fragmentId, - linkMap: longnameToUrl - }); -}; - -function useMonospace(tag, text) { - var cleverLinks; - var monospaceLinks; - var result; - - if ( hasUrlPrefix(text) ) { - result = false; - } - else if (tag === 'linkplain') { - result = false; - } - else if (tag === 'linkcode') { - result = true; - } - else { - cleverLinks = env.conf.templates.cleverLinks; - monospaceLinks = env.conf.templates.monospaceLinks; - - if (monospaceLinks || cleverLinks) { - result = true; - } - } - - return result || false; -} - -function splitLinkText(text) { - var linkText; - var target; - var splitIndex; - - // if a pipe is not present, we split on the first space - splitIndex = text.indexOf('|'); - if (splitIndex === -1) { - splitIndex = text.search(/\s/); - } - - if (splitIndex !== -1) { - linkText = text.substr(splitIndex + 1); - // Normalize subsequent newlines to a single space. - linkText = linkText.replace(/\n+/, ' '); - target = text.substr(0, splitIndex); - } - - return { - linkText: linkText, - target: target || text - }; -} - -var tutorialToUrl = exports.tutorialToUrl = function(tutorial) { - 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; - } - - return tutorialLinkMap.nameToUrl[node.name]; -}; - -/** - * Retrieve a link to a tutorial, or the name of the tutorial if the tutorial is missing. If the - * `missingOpts` parameter is supplied, the names of missing tutorials will be prefixed by the - * specified text and wrapped in the specified HTML tag and CSS class. - * - * @todo Deprecate missingOpts once we have a better error-reporting mechanism. - * @param {string} tutorial The name of the tutorial. - * @param {string} content The link text to use. - * @param {object} [missingOpts] Options for displaying the name of a missing tutorial. - * @param {string} missingOpts.classname The CSS class to wrap around the tutorial name. - * @param {string} missingOpts.prefix The prefix to add to the tutorial name. - * @param {string} missingOpts.tag The tag to wrap around the tutorial name. - * @return {string} An HTML link to the tutorial, or the name of the tutorial with the specified - * options. - */ -var toTutorial = exports.toTutorial = function(tutorial, content, missingOpts) { - if (!tutorial) { - require('jsdoc/util/logger').error( new Error('Missing required parameter: tutorial') ); - return null; - } - - var node = tutorials.getByName(tutorial); - // no such tutorial - if (!node) { - missingOpts = missingOpts || {}; - var tag = missingOpts.tag; - var classname = missingOpts.classname; - - var link = tutorial; - if (missingOpts.prefix) { - link = missingOpts.prefix + link; - } - if (tag) { - link = '<' + tag + (classname ? (' class="' + classname + '">') : '>') + link; - link += ''; - } - return link; - } - - content = content || node.title; - - return '' + content + ''; -}; - -/** Find symbol {@link ...} and {@tutorial ...} strings in text and turn into html links */ -exports.resolveLinks = function(str) { - var replaceInlineTags = require('jsdoc/tag/inline').replaceInlineTags; - - function extractLeadingText(string, completeTag) { - var tagIndex = string.indexOf(completeTag); - var leadingText = null; - var leadingTextRegExp = /\[(.+?)\]/g; - var leadingTextInfo = leadingTextRegExp.exec(string); - - // did we find leading text, and if so, does it immediately precede the tag? - while (leadingTextInfo && leadingTextInfo.length) { - if (leadingTextInfo.index + leadingTextInfo[0].length === tagIndex) { - string = string.replace(leadingTextInfo[0], ''); - leadingText = leadingTextInfo[1]; - break; - } - - leadingTextInfo = leadingTextRegExp.exec(string); - } - - return { - leadingText: leadingText, - string: string - }; - } - - function processLink(string, tagInfo) { - var leading = extractLeadingText(string, tagInfo.completeTag); - var linkText = leading.leadingText; - var monospace; - var split; - var target; - string = leading.string; - - split = splitLinkText(tagInfo.text); - target = split.target; - linkText = linkText || split.linkText; - - monospace = useMonospace(tagInfo.tag, tagInfo.text); - - return string.replace( tagInfo.completeTag, buildLink(target, linkText, { - linkMap: longnameToUrl, - monospace: monospace - }) ); - } - - function processTutorial(string, tagInfo) { - var leading = extractLeadingText(string, tagInfo.completeTag); - string = leading.string; - - return string.replace( tagInfo.completeTag, toTutorial(tagInfo.text, leading.leadingText) ); - } - - var replacers = { - link: processLink, - linkcode: processLink, - linkplain: processLink, - tutorial: processTutorial - }; - - return replaceInlineTags(str, replacers).newString; -}; - -/** Convert tag text like "Jane Doe " into a mailto link */ -exports.resolveAuthorLinks = function(str) { - var author; - var matches = str.match(/^\s?([\s\S]+)\b\s+<(\S+@\S+)>\s?$/); - if (matches && matches.length === 3) { - author = '' + htmlsafe(matches[1]) + ''; - } - else { - author = htmlsafe(str); - } - - return author; -}; - -/** - * Find items in a TaffyDB database that match the specified key-value pairs. - * @param {TAFFY} data The TaffyDB database to search. - * @param {object|function} spec Key-value pairs to match against (for example, - * `{ longname: 'foo' }`), or a function that returns `true` if a value matches or `false` if it - * does not match. - * @return {array} The matching items. - */ -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: - * - * + Classes - * + Externals - * + Globals - * + Mixins - * + Modules - * + Namespaces - * + Events - * @param {TAFFY} data The TaffyDB database to search. - * @return {object} An object with `classes`, `externals`, `globals`, `mixins`, `modules`, - * `events`, and `namespaces` properties. Each property contains an array of objects. - */ -exports.getMembers = function(data) { - var members = { - classes: find( data, {kind: 'class'} ), - externals: find( data, {kind: 'external'} ), - events: find( data, {kind: 'event'} ), - globals: find(data, { - kind: ['member', 'function', 'constant', 'typedef'], - memberof: { isUndefined: true } - }), - mixins: find( data, {kind: 'mixin'} ), - modules: find( data, {kind: 'module'} ), - namespaces: find( data, {kind: 'namespace'} ) - }; - - // functions that are also modules (as in "module.exports = function() {};") are not globals - members.globals = members.globals.filter(function(doclet) { - return !isModuleExports(doclet); - }); - - return members; -}; - -/** - * Retrieve the member attributes for a doclet (for example, `virtual`, `static`, and - * `readonly`). - * @param {object} d The doclet whose attributes will be retrieved. - * @return {array} The member attributes for the doclet. - */ -exports.getAttribs = function(d) { - var attribs = []; - - if (d.virtual) { - attribs.push('abstract'); - } - - if (d.access && d.access !== 'public') { - attribs.push(d.access); - } - - if (d.scope && d.scope !== 'instance' && d.scope !== 'global') { - if (d.kind === 'function' || d.kind === 'member' || d.kind === 'constant') { - attribs.push(d.scope); - } - } - - if (d.readonly === true) { - if (d.kind === 'member') { - attribs.push('readonly'); - } - } - - if (d.kind === 'constant') { - attribs.push('constant'); - } - - if (d.nullable === true) { - attribs.push('nullable'); - } - else if (d.nullable === false) { - attribs.push('non-null'); - } - - return attribs; -}; - -/** - * Retrieve links to allowed types for the member. - * - * @param {Object} d - The doclet whose types will be retrieved. - * @param {string} [cssClass] - The CSS class to include in the `class` attribute for each link. - * @return {Array.} HTML links to allowed types for the member. - */ -exports.getSignatureTypes = function(d, cssClass) { - var types = []; - - if (d.type && d.type.names) { - types = d.type.names; - } - - if (types && types.length) { - types = types.map(function(t) { - return linkto(t, htmlsafe(t), cssClass); - }); - } - - return types; -}; - -/** - * Retrieve names of the parameters that the member accepts. If a value is provided for `optClass`, - * the names of optional parameters will be wrapped in a `` tag with that class. - * @param {object} d The doclet whose parameter names will be retrieved. - * @param {string} [optClass] The class to assign to the `` tag that is wrapped around the - * names of optional parameters. If a value is not provided, optional parameter names will not be - * wrapped with a `` tag. Must be a legal value for a CSS class name. - * @return {array} An array of parameter names, with or without `` tags wrapping the - * names of optional parameters. - */ -exports.getSignatureParams = function(d, optClass) { - var pnames = []; - - if (d.params) { - d.params.forEach(function(p) { - if (p.name && p.name.indexOf('.') === -1) { - if (p.optional && optClass) { - pnames.push('' + p.name + ''); - } - else { - pnames.push(p.name); - } - } - }); - } - - return pnames; -}; - -/** - * Retrieve links to types that the member can return. - * - * @param {Object} d - The doclet whose types will be retrieved. - * @param {string} [cssClass] - The CSS class to include in the `class` attribute for each link. - * @return {Array.} HTML links to types that the member can return. - */ -exports.getSignatureReturns = function(d, cssClass) { - var returnTypes = []; - - if (d.returns) { - d.returns.forEach(function(r) { - if (r && r.type && r.type.names) { - if (!returnTypes.length) { - returnTypes = r.type.names; - } - } - }); - } - - if (returnTypes && returnTypes.length) { - returnTypes = returnTypes.map(function(r) { - return linkto(r, htmlsafe(r), cssClass); - }); - } - - return returnTypes; -}; - -/** - * Retrieve links to a member's ancestors. - * - * @param {TAFFY} data - The TaffyDB database to search. - * @param {Object} doclet - The doclet whose ancestors will be retrieved. - * @param {string} [cssClass] - The CSS class to include in the `class` attribute for each link. - * @return {Array.} HTML links to a member's ancestors. - */ -exports.getAncestorLinks = function(data, doclet, cssClass) { - var ancestors = [], - doc = doclet.memberof; - - 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; - } - if (ancestors.length) { - ancestors[ancestors.length - 1] += (exports.scopeToPunc[doclet.scope] || ''); - } - return ancestors; -}; - -/** - * Iterates through all the doclets in `data`, ensuring that if a method - * @listens to an event, then that event has a 'listeners' array with the - * longname of the listener in it. - * - * @param {TAFFY} data - The TaffyDB database to search. - */ -exports.addEventListeners = function(data) { - // TODO: do this on the *pruned* data - // find all doclets that @listen to something. - var listeners = find(data, function () { return this.listens && this.listens.length; }); - - if (!listeners.length) { - return; - } - - var doc, - l, - _events = {}; // just a cache to prevent me doing so many lookups - - listeners.forEach(function (listener) { - l = listener.listens; - l.forEach(function (eventLongname) { - doc = _events[eventLongname] || find(data, {longname: eventLongname, kind: 'event'})[0]; - if (doc) { - if (!doc.listeners) { - doc.listeners = [listener.longname]; - } else { - doc.listeners.push(listener.longname); - } - _events[eventLongname] = _events[eventLongname] || doc; - } - }); - }); -}; - -/** - * Remove members that will not be included in the output, including: - * - * + Undocumented members. - * + Members tagged `@ignore`. - * + Members of anonymous classes. - * + Members tagged `@private`, unless the `private` option is enabled. - * @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(); - - 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 - */ -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 longname = doclet.longname; - - // 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 - // somehow has doclet.kind set to `member`). - // TODO: generate a warning (ideally during parsing!) - if (containers.indexOf(doclet.kind) === -1) { - match = /(\S+):/.exec(longname); - if (match && containers.indexOf(match[1]) !== -1) { - fakeContainer = match[1]; - } - } - - // the doclet gets its own HTML file - if ( containers.indexOf(doclet.kind) !== -1 || isModuleExports(doclet) ) { - filename = getFilename(longname); - } - // 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 || ''; - } - } - // the doclet is within another HTML file - else { - filename = getFilename(doclet.memberof || exports.globalName); - fragment = getNamespace(doclet.kind) + (doclet.name || ''); - } - - url = fragment ? (filename + INSTANCE + fragment) : filename; - - return url; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/marked b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/marked deleted file mode 120000 index a8d872e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/marked +++ /dev/null @@ -1 +0,0 @@ -../marked/bin/marked \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/LICENSE b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/LICENSE deleted file mode 100644 index 6fdbb08..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Copyright (c) 2014 Google Inc. -Copyright (c) 2012-2014 Jeff Williams - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/README.md deleted file mode 100644 index ecd4945..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/README.md +++ /dev/null @@ -1,337 +0,0 @@ -# Catharsis # - -A JavaScript parser for -[Google Closure Compiler](https://developers.google.com/closure/compiler/docs/js-for-compiler#types) -and [JSDoc](https://github.com/jsdoc3/jsdoc) type expressions. - -Catharsis is designed to be: - -+ **Accurate**. Catharsis is based on a [PEG.js](http://pegjs.majda.cz/) grammar that's designed to -handle any valid type expression. It uses a [Mocha](http://visionmedia.github.com/mocha/) test suite -to verify the parser's accuracy. -+ **Fast**. Parse results are cached, so the parser is invoked only when necessary. -+ **Flexible**. Catharsis can convert a parse result back into a type expression, or into a -description of the type expression. In addition, Catharsis can parse -[JSDoc](https://github.com/jsdoc3/jsdoc)-style type expressions. - - -## Example ## - -```js -var catharsis = require('catharsis'); - -// Google Closure Compiler parsing -var type = '!Object'; -var parsedType; -try { - parsedType = catharsis.parse(type); // {"type":"NameExpression,"name":"Object","nullable":false} -} catch(e) { - console.error('unable to parse %s: %s', type, e); -} - -// JSDoc-style type expressions enabled -var jsdocType = 'string[]'; // Closure Compiler expects Array. -var parsedJsdocType; -try { - parsedJsdocType = catharsis.parse(jsdocType, {jsdoc: true}); -} catch (e) { - console.error('unable to parse %s: %s', jsdocType, e); -} - -// Converting parse results back to type expressions -catharsis.stringify(parsedType); // !Object -catharsis.stringify(parsedJsdocType); // string[] -catharsis.stringify(parsedJsdocType, {restringify: true}); // Array. - -// Converting parse results to descriptions of the type expression -catharsis.describe(parsedType).simple; // non-null Object -catharsis.describe(parsedJsdocType).simple; // Array of string -``` - -See the [test/specs directory](test/specs) for more examples of Catharsis' parse results. - - -## Methods ## - -### parse(typeExpression, options) ### -Parse a type expression, and return the parse results. Throws an error if the type expression cannot -be parsed. - -When called without options, Catharsis attempts to parse type expressions in the same way as -Closure Compiler. When the `jsdoc` option is enabled, Catharsis can also parse several kinds of -type expressions that are permitted in [JSDoc](https://github.com/jsdoc3/jsdoc): - -+ The string `function` is treated as a function type with no parameters. -+ In a function type with repeatable parameters, the names of repeatable parameters are not required -to be enclosed in square brackets (for example, `function(...foo)` is allowed). -+ The period may be omitted from type applications. For example, `Array.` and -`Array` will be parsed in the same way. -+ You may append `[]` to a name expression (for example, `string[]`) to interpret it as a type -application with the expression `Array` (for example, `Array.`). -+ Name expressions may contain the characters `#`, `~`, `:`, and `/`. -+ Name expressions may contain a suffix that is similar to a function signature (for example, -`MyClass(foo, bar)`). -+ Name expressions may contain a reserved word. -+ Record types may use types other than name expressions for keys. - -#### Parameters #### -+ `type`: A string containing a Closure Compiler type expression. -+ `options`: Options for parsing the type expression. - + `options.jsdoc`: Specifies whether to enable parsing of JSDoc-style type expressions. Defaults - to `false`. - + `options.useCache`: Specifies whether to use the cache of parsed types. Defaults to `true`. - -#### Returns #### -An object containing the parse results. See the [test/specs directory](test/specs) for examples of -the parse results for different type expressions. - -The object also includes two non-enumerable properties: - -+ `jsdoc`: A boolean indicating whether the type expression was parsed with JSDoc support enabled. -+ `typeExpression`: A string containing the type expression that was parsed. - -### stringify(parsedType, options) ### -Stringify `parsedType`, and return the type expression. If validation is enabled, throws an error if -the stringified type expression cannot be parsed. - -#### Parameters #### -+ `parsedType`: An object containing a parsed Closure Compiler type expression. -+ `options`: Options for stringifying the parse results. - + `options.cssClass`: Synonym for `options.linkClass`. Deprecated in version 0.8.0; will be - removed in a future version. - + `options.htmlSafe`: Specifies whether to return an HTML-safe string that replaces left angle - brackets (`<`) with the corresponding entity (`<`). **Note**: Characters in name expressions - are not escaped. - + `options.linkClass`: A CSS class to add to HTML links. Used only if `options.links` is - provided. By default, no CSS class is added. - + `options.links`: An object whose keys are name expressions and whose values are URIs. If a - name expression matches a key in `options.links`, the name expression will be wrapped in an - HTML `` tag that links to the URI. If `options.linkClass` is specified, the `` tag will - include a `class` attribute. **Note**: When using this option, parsed types are always - restringified, and the resulting string is not cached. - + `options.restringify`: Forces Catharsis to restringify the parsed type. If this option is not - specified, and the parsed type object includes a `typeExpression` property, Catharsis will - return the `typeExpression` property without modification when possible. Defaults to `false`. - + `options.useCache`: Specifies whether to use the cache of stringified type expressions. - Defaults to `true`. - + `options.validate`: Specifies whether to validate the stringified parse results by attempting - to parse them as a type expression. If the stringified results are not parsable by default, you - must also provide the appropriate options to pass to the `parse()` method. Defaults to `false`. - -#### Returns #### -A string containing the type expression. - -### describe(parsedType, options) ### -Convert a parsed type to a description of the type expression. This method is especially useful if -your users are not familiar with the syntax for type expressions. - -The `describe()` method returns the description in two formats: - -+ **Simple format**. A string that provides a complete description of the type expression. -+ **Extended format**. An object that separates out some of the details about the outermost type -expression, such as whether the type is optional, nullable, or repeatable. - -For example, if you call `describe('?function(new:MyObject, string)=')`, it returns the following -object: - -```js -{ - simple: 'optional nullable function(constructs MyObject, string)', - extended: { - description: 'function(string)', - modifiers: { - functionNew: 'Returns MyObject when called with new.', - functionThis: '', - optional: 'Optional.', - nullable: 'May be null.', - repeatable: '' - }, - returns: '' - } -} -``` - -#### Parameters #### -+ `parsedType`: An object containing a parsed Closure Compiler type expression. -+ `options`: Options for creating the description. - + `options.codeClass`: A CSS class to add to the tag that is wrapped around type names. Used - only if `options.codeTag` is provided. By default, no CSS class is added. - + `options.codeTag`: The name of an HTML tag (for example, `code`) to wrap around type names. - For example, if this option is set to `code`, the type expression `Array.` would have - the simple description `Array of string`. - + `options.language`: A string identifying the language in which to generate the description. - The identifier should be an - [ISO 639-1 language code](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (for example, - `en`). It can optionally be followed by a hyphen and an - [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) (for example, - `en-US`). If you use values other than `en`, you must provide translation resources in - `options.resources`. Defaults to `en`. - + `options.linkClass`: A CSS class to add to HTML links. Used only if `options.links` is - provided. By default, no CSS class is added. - + `options.links`: An object whose keys are name expressions and whose values are URIs. If a - name expression matches a key in `options.links`, the name expression will be wrapped in an - HTML `` tag that links to the URI. If `options.linkClass` is specified, the `` tag will - include a `class` attribute. **Note**: When using this option, the description is not cached. - + `options.resources`: An object that specifies how to describe type expressions for a given - language. The object's property names should use the same format as `options.language`. Each - property should contain an object in the same format as the translation resources in - [res/en.json](res/en.json). If you specify a value for `options.resources.en`, it will override - the defaults in [res/en.json](res/en.json). - + `options.useCache`: Specifies whether to use the cache of descriptions. Defaults to `true`. - -### Returns ### -An object with the following properties: - -+ `simple`: A string that provides a complete description of the type expression. -+ `extended`: An object containing details about the outermost type expression. - + `extended.description`: A string that provides a basic description of the type expression, - excluding the information contained in other properties. - + `extended.modifiers`: Information about modifiers that apply to the type expression. - + `extended.modifiers.functionNew`: A string describing what a function returns when called - with `new`. Used only for function types. - + `extended.modifiers.functionThis`: A string describing what the keyword `this` refers to - within a function. Used only for function types. - + `extended.modifiers.nullable`: A string indicating whether the type is nullable or - non-nullable. - + `extended.modifiers.optional`: A string indicating whether the type is optional. - + `extended.modifiers.repeatable`: A string indicating whether the type can be provided - + `extended.returns`: A string describing the function's return value. Used only for function - types. - - -## Installation ## - -With [npm](http://npmjs.org): - - npm install catharsis - -Or without: - - git clone git://github.com/hegemonic/catharsis.git - cd catharsis - npm install - - -## Roadmap and known issues ## - -Take a look at the [issue tracker](https://github.com/hegemonic/catharsis/issues) to see what's in -store for Catharsis. - -Bug reports, feature requests, and pull requests are always welcome! If you're working on a large -pull request, please contact me in advance so I can help things go smoothly. - -**Note**: The parse tree's format should not be considered final until Catharsis reaches version -1.0. I'll do my best to provide release notes for any changes. - - -## Changelog ## - -+ 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. - + Type unions that are not enclosed in parentheses can now include the repeatable (`...`) - modifier when JSDoc-style type expressions are enabled. - + Name expressions may now be enclosed in single or double quotation marks when JSDoc-style - type expressions are enabled. -+ 0.8.2 (June 2014): Fixed a compatibility issue with the JSDoc fork of Mozilla Rhino. -+ 0.8.1 (June 2014): Added support for type unions that are not enclosed in parentheses, and that -contain nullable or non-nullable modifiers (for example, `!string|!number`). -+ 0.8.0 (May 2014): - + Added a `describe()` method, which converts a parsed type to a description of the type. - + Added a `linkClass` option to the `stringify()` method, and deprecated the existing `cssClass` - option. The `cssClass` option will be removed in a future release. - + Clarified and corrected several sections in the `README`. -+ 0.7.1 (April 2014): In record types, property names that begin with a keyword (for example, -`undefinedHTML`) are now parsed correctly when JSDoc-style type expressions are enabled. -+ 0.7.0 (October 2013): - + Repeatable type expressions other than name expressions (for example, `...function()`) are now - parsed and stringified correctly. - + Type expressions that are both repeatable and either nullable or non-nullable (for example, - `...!number`) are now parsed and stringified correctly. - + Name expressions are now parsed correctly when they match a property name in an object - instance (for example, `constructor`). -+ 0.6.0 (September 2013): Added support for the type expression `function[]` when JSDoc-style type -expressions are enabled. -+ 0.5.6 (April 2013): - + For consistency with Google Closure Library, parentheses are no longer required around type - unions. (In previous versions, the parentheses could be omitted when JSDoc support was enabled.) - + For consistency with Google Closure Library, you can now use postfix notation for the `?` - (nullable) and `!` (non-nullable) modifiers. For example, `?string` and `string?` are now - treated as equivalent. - + String literals and numeric literals are now allowed as property names within name - expressions. For example, the name expression `Foo."bar"` is now parsed correctly. -+ 0.5.5 (April 2013): Corrected a parsing issue with name expressions that end with a value enclosed -in parentheses. -+ 0.5.4 (April 2013): - + Repeatable literals (for example, `...*`) are now parsed correctly. - + When JSDoc-style type expressions are enabled, a name expression can now contain a value - enclosed in parentheses at the end of the name expression (for example, `MyClass(2)`). -+ 0.5.3 (March 2013): The `parse()` method now correctly parses name expressions that contain -hyphens. -+ 0.5.2 (March 2013): The `parse()` method now correctly parses function types when JSDoc-style type -expressions are enabled. -+ 0.5.1 (March 2013): Newlines and extra spaces are now removed from type expressions before they -are parsed. -+ 0.5.0 (March 2013): - + The `parse()` method's `lenient` option has been renamed to `jsdoc`. **Note**: This change is - not backwards-compatible with previous versions. - + The `stringify()` method now accepts `cssClass` and `links` options, which you can use to - add HTML links to a type expression. -+ 0.4.3 (March 2013): - + The `stringify()` method no longer caches HTML-safe type expressions as if they were normal - type expressions. - + The `stringify()` method's options parameter may now include an `options.restringify` - property, and the behavior of the `options.useCache` property has changed. -+ 0.4.2 (March 2013): - + When lenient parsing is enabled, name expressions can now contain the characters `:` and `/`. - + When lenient parsing is enabled, a name expression followed by `[]` (for example, `string[]`) - will be interpreted as a type application with the expression `Array` (for example, - `Array.`). -+ 0.4.1 (March 2013): - + The `parse()` and `stringify()` methods now honor all of the specified options. - + When lenient parsing is enabled, name expressions can now contain a reserved word. -+ 0.4.0 (March 2013): - + Catharsis now supports a lenient parsing option that can parse several kinds of malformed type - expressions. See the documentation for details. - + The objects containing parse results are now frozen. - + The objects containing parse results now have two non-enumerable properties: - + `lenient`: A boolean indicating whether the type expression was parsed in lenient mode. - + `typeExpression`: A string containing the original type expression. - + The `stringify()` method now honors the `useCache` option. If a parsed type includes a - `typeExpression` property, and `useCache` is not set to `false`, the stringified type will be - identical to the original type expression. -+ 0.3.1 (March 2013): Type expressions that begin with a reserved word, such as `integer`, are now -parsed correctly. -+ 0.3.0 (March 2013): - + The `parse()` and `stringify()` methods are now synchronous, and the `parseSync()` and - `stringifySync()` methods have been removed. **Note**: This change is not backwards-compatible - with previous versions. - + The parse results now use a significantly different format from previous versions. The new - format is more expressive and is similar, but not identical, to the format used by the - [doctrine](https://github.com/Constellation/doctrine) parser. **Note**: This change is not - backwards-compatible with previous versions. - + Name expressions that contain a reserved word now include a `reservedWord: true` property. - + Union types that are optional or nullable, or that can be passed a variable number of times, - are now parsed and stringified correctly. - + Optional function types and record types are now parsed and stringified correctly. - + Function types now longer include `new` or `this` properties unless the properties are defined - in the type expression. In addition, the `new` and `this` properties can now use any type - expression. - + In record types, the key for a field type can now use any type expression. - + Standalone single-character literals, such as ALL (`*`), are now parsed and stringified - correctly. - + `null` and `undefined` literals with additional properties, such as `repeatable`, are now - stringified correctly. -+ 0.2.0 (November 2012): - + Added `stringify()` and `stringifySync()` methods, which convert a parsed type to a type - expression. - + Simplified the parse results for function signatures. **Note**: This change is not - backwards-compatible with previous versions. - + Corrected minor errors in README.md. -+ 0.1.1 (November 2012): Added `opts` argument to `parse()` and `parseSync()` methods. **Note**: The -change to `parse()` is not backwards-compatible with previous versions. -+ 0.1.0 (November 2012): Initial release. - -## License ## - -[MIT license](https://github.com/hegemonic/catharsis/blob/master/LICENSE). diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js deleted file mode 100755 index 0f00579..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -// Command-line tool that parses a type expression and dumps a JSON version of the parse tree. -var catharsis = require('../catharsis'); -var path = require('path'); -var util = require('util'); - -var command = path.basename(process.argv[1]); -var typeExpression = process.argv[2]; -var opts = { - describe: false, - jsdoc: false -}; -var parsedType; - -function usage() { - console.log(util.format('Usage:\n %s typeExpression [--jsdoc] [--describe]', command)); -} - -function done(err) { - /*eslint no-process-exit: 0 */ - process.exit(err === undefined ? 0 : err); -} - -process.argv.slice(3).forEach(function(arg) { - var parsedArg = arg.replace(/^\-{2}/, ''); - if (opts[parsedArg] !== undefined) { - opts[parsedArg] = true; - } else { - console.error('Unknown option "%s"', arg); - usage(); - done(1); - } -}); - -if (!typeExpression) { - usage(); - done(1); -} else { - try { - parsedType = catharsis.parse(typeExpression, opts); - if (opts.describe) { - parsedType = catharsis.describe(parsedType); - } - } catch (e) { - console.error(util.format('Unable to parse "%s" (exception follows):', typeExpression)); - console.error(e.stack || e.message); - done(1); - } - - console.log(JSON.stringify(parsedType, null, 2)); - done(); -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/catharsis.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/catharsis.js deleted file mode 100644 index 7899f3c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/catharsis.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Catharsis - * A parser for Google Closure Compiler type expressions, powered by PEG.js. - * - * @author Jeff Williams - * @license MIT License - */ - -'use strict'; - -var describe = require('./lib/describe'); -var parse = require('./lib/parser').parse; -var stringify = require('./lib/stringify'); - -var typeExpressionCache = { - normal: {}, - jsdoc: {} -}; - -var parsedTypeCache = { - normal: {}, - htmlSafe: {} -}; - -var descriptionCache = { - normal: {} -}; - -function getTypeExpressionCache(options) { - if (options.useCache === false) { - return null; - } else if (options.jsdoc === true) { - return typeExpressionCache.jsdoc; - } else { - return typeExpressionCache.normal; - } -} - -function getParsedTypeCache(options) { - if (options.useCache === false || options.links !== null || options.links !== undefined) { - return null; - } else if (options.htmlSafe === true) { - return parsedTypeCache.htmlSafe; - } else { - return parsedTypeCache.normal; - } -} - -function getDescriptionCache(options) { - if (options.useCache === false || options.links !== null || options.links !== undefined) { - return null; - } else { - return descriptionCache.normal; - } -} - -// can't return the original if any of the following are true: -// 1. restringification was requested -// 2. htmlSafe option was requested -// 3. links option was provided -// 4. typeExpression property is missing -function canReturnOriginalExpression(parsedType, options) { - return options.restringify !== true && options.htmlSafe !== true && - (options.links === null || options.links === undefined) && - Object.prototype.hasOwnProperty.call(parsedType, 'typeExpression'); -} - -// Add non-enumerable properties to a result object, then freeze it. -function prepareFrozenObject(obj, expr, options) { - Object.defineProperty(obj, 'jsdoc', { - value: options.jsdoc === true ? true : false - }); - - if (expr) { - Object.defineProperty(obj, 'typeExpression', { - value: expr - }); - } - - return Object.freeze(obj); -} - -function cachedParse(expr, options) { - var cache = getTypeExpressionCache(options); - var parsedType; - - if (cache && Object.prototype.hasOwnProperty.call(cache, expr)) { - return cache[expr]; - } else { - parsedType = parse(expr, options); - parsedType = prepareFrozenObject(parsedType, expr, options); - - if (cache) { - cache[expr] = parsedType; - } - - return parsedType; - } -} - -function cachedStringify(parsedType, options) { - var cache = getParsedTypeCache(options); - var json; - - if (canReturnOriginalExpression(parsedType, options)) { - return parsedType.typeExpression; - } else if (cache) { - json = JSON.stringify(parsedType); - cache[json] = cache[json] || stringify(parsedType, options); - return cache[json]; - } else { - return stringify(parsedType, options); - } -} - -function cachedDescribe(parsedType, options) { - var cache = getDescriptionCache(options); - var json; - var result; - - if (cache) { - json = JSON.stringify(parsedType); - cache[json] = cache[json] || describe(parsedType, options); - return cache[json]; - } else { - result = describe(parsedType, options); - result = prepareFrozenObject(result, null, options); - - return result; - } -} - -function Catharsis() { - this.Types = require('./lib/types'); -} - -Catharsis.prototype.parse = function(typeExpr, options) { - options = options || {}; - - typeExpr = typeExpr.replace(/[\r\n]/g, '') - .replace(/\s+/g, ' ') - .trim(); - - return cachedParse(typeExpr, options); -}; - -Catharsis.prototype.stringify = function(parsedType, options) { - var result; - - options = options || {}; - - result = cachedStringify(parsedType, options); - if (options.validate) { - this.parse(result, options); - } - - return result; -}; - -Catharsis.prototype.describe = function(parsedType, options) { - options = options || {}; - - return cachedDescribe(parsedType, options); -}; - -module.exports = new Catharsis(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/parser.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/parser.js deleted file mode 100644 index dab624b..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/parser.js +++ /dev/null @@ -1,4 +0,0 @@ -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'; - - return result; -}; - -Stringifier.prototype.elements = function(elements) { - var result = ''; - var strings = []; - - if (!elements) { - return result; - } - - for (var i = 0, l = elements.length; i < l; i++) { - strings.push(this.type(elements[i])); - } - - result = '(' + strings.join('|') + ')'; - - return result; -}; - -Stringifier.prototype.name = function(name) { - return name || ''; -}; - -Stringifier.prototype['new'] = function(funcNew) { - return funcNew ? 'new:' + this.type(funcNew) : ''; -}; - -Stringifier.prototype.nullable = function(nullable) { - switch (nullable) { - case true: - return '?'; - case false: - return '!'; - default: - return ''; - } -}; - -Stringifier.prototype.optional = function(optional) { - if (optional === true) { - return '='; - } else { - return ''; - } -}; - -Stringifier.prototype.params = function(params) { - var result = ''; - var strings = []; - - if (!params || params.length === 0) { - return result; - } - - for (var i = 0, l = params.length; i < l; i++) { - strings.push(this.type(params[i])); - } - - result = strings.join(', '); - - return result; -}; - -Stringifier.prototype.result = function(result) { - return result ? ': ' + this.type(result) : ''; -}; - -Stringifier.prototype['this'] = function(funcThis) { - return funcThis ? 'this:' + this.type(funcThis) : ''; -}; - -Stringifier.prototype.type = function(type) { - var typeString = ''; - - if (!type) { - return typeString; - } - - switch(type.type) { - case Types.AllLiteral: - typeString = this._formatNameAndType(type, '*'); - break; - case Types.FunctionType: - typeString = this._signature(type); - break; - case Types.NullLiteral: - typeString = this._formatNameAndType(type, 'null'); - break; - case Types.RecordType: - typeString = this._record(type); - break; - case Types.TypeApplication: - typeString = this.type(type.expression) + this.applications(type.applications); - break; - case Types.UndefinedLiteral: - typeString = this._formatNameAndType(type, 'undefined'); - break; - case Types.TypeUnion: - typeString = this.elements(type.elements); - break; - case Types.UnknownLiteral: - typeString = this._formatNameAndType(type, '?'); - break; - default: - typeString = this._formatNameAndType(type); - } - - // add optional/nullable/repeatable modifiers - if (!this._options._ignoreModifiers) { - typeString = this._addModifiers(type, typeString); - } - - return typeString; -}; - -Stringifier.prototype.stringify = Stringifier.prototype.type; - -Stringifier.prototype.key = Stringifier.prototype.type; - -Stringifier.prototype._record = function(type) { - var fields = this._recordFields(type.fields); - - return '{' + fields.join(', ') + '}'; -}; - -Stringifier.prototype._recordFields = function(fields) { - var field; - var keyAndValue; - - var result = []; - - if (!fields) { - return result; - } - - for (var i = 0, l = fields.length; i < l; i++) { - field = fields[i]; - - keyAndValue = this.key(field.key); - keyAndValue += field.value ? ': ' + this.type(field.value) : ''; - - result.push(keyAndValue); - } - - return result; -}; - -function combineNameAndType(nameString, typeString) { - var separator = (nameString && typeString) ? ':' : ''; - - return nameString + separator + typeString; -} - -// Adds optional, nullable, and repeatable modifiers if necessary. -Stringifier.prototype._addModifiers = function(type, typeString) { - var combined; - - var open = ''; - var close = ''; - var optional = ''; - - if (type.repeatable) { - open = this._inFunctionSignatureParams ? '...[' : '...'; - close = this._inFunctionSignatureParams ? ']' : ''; - } - - combined = this.nullable(type.nullable) + combineNameAndType('', typeString); - optional = this.optional(type.optional); - - return open + combined + close + optional; -}; - -Stringifier.prototype._addLinks = function(nameString) { - var openTag; - - var linkClass = ''; - var options = this._options; - - if (options.links && Object.prototype.hasOwnProperty.call(options.links, nameString)) { - if (options.linkClass) { - linkClass = ' class="' + options.linkClass + '"'; - } - - openTag = ''; - nameString = openTag + nameString + ''; - } - - return nameString; -}; - -Stringifier.prototype._formatNameAndType = function(type, literal) { - var nameString = type.name || literal || ''; - var typeString = type.type ? this.type(type.type) : ''; - - nameString = this._addLinks(nameString); - - return combineNameAndType(nameString, typeString); -}; - -Stringifier.prototype._signature = function(type) { - var param; - var prop; - var signature; - - var params = []; - // these go within the signature's parens, in this order - var props = [ - 'new', - 'this', - 'params' - ]; - - this._inFunctionSignatureParams = true; - for (var i = 0, l = props.length; i < l; i++) { - prop = props[i]; - param = this[prop](type[prop]); - if (param.length > 0) { - params.push(param); - } - } - this._inFunctionSignatureParams = false; - - signature = 'function(' + params.join(', ') + ')'; - signature += this.result(type.result); - - return signature; -}; - - -module.exports = function(type, options) { - return new Stringifier(options).stringify(type); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/types.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/types.js deleted file mode 100644 index 017aba6..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/types.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -module.exports = Object.freeze({ - // `*` - AllLiteral: 'AllLiteral', - // like `blah` in `{blah: string}` - FieldType: 'FieldType', - // like `function(string): string` - FunctionType: 'FunctionType', - // any string literal, such as `string` or `My.Namespace` - NameExpression: 'NameExpression', - // null - NullLiteral: 'NullLiteral', - // like `{foo: string}` - RecordType: 'RecordType', - // like `Array.` - TypeApplication: 'TypeApplication', - // like `(number|string)` - TypeUnion: 'TypeUnion', - // undefined - UndefinedLiteral: 'UndefinedLiteral', - // `?` - UnknownLiteral: 'UnknownLiteral' -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/package.json b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/package.json deleted file mode 100644 index df0e422..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "version": "0.8.3", - "name": "catharsis", - "description": "A JavaScript parser for Google Closure Compiler and JSDoc type expressions.", - "author": { - "name": "Jeff Williams", - "email": "jeffrey.l.williams@gmail.com" - }, - "repository": { - "type": "git", - "url": "https://github.com/hegemonic/catharsis" - }, - "bugs": { - "url": "https://github.com/hegemonic/catharsis/issues" - }, - "main": "catharsis.js", - "dependencies": { - "underscore-contrib": "~0.3.0" - }, - "devDependencies": { - "mocha": "~1.21.3", - "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" - }, - "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", - "test": "mocha" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/hegemonic/catharsis/raw/master/LICENSE" - } - ], - "gitHead": "8795105b00acf02d0af464ad3432f47b53744934", - "homepage": "https://github.com/hegemonic/catharsis", - "_id": "catharsis@0.8.3", - "_shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", - "_from": "catharsis@>=0.8.2 <0.9.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "hegemonic", - "email": "jeffrey.l.williams@gmail.com" - }, - "maintainers": [ - { - "name": "hegemonic", - "email": "jeffrey.l.williams@gmail.com" - } - ], - "dist": { - "shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", - "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz" -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore deleted file mode 100644 index 64e78fe..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore +++ /dev/null @@ -1,166 +0,0 @@ -.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 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md deleted file mode 100644 index 1b76d2f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -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/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/README.md deleted file mode 100644 index 01f89dd..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/README.md +++ /dev/null @@ -1,196 +0,0 @@ -# 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. diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js deleted file mode 100644 index dfd9ba4..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js +++ /dev/null @@ -1,116 +0,0 @@ -/* 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)); -})(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js deleted file mode 100644 index f96c97b..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js +++ /dev/null @@ -1,328 +0,0 @@ -/* 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"; - }; -})(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/package.json b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/package.json deleted file mode 100644 index b4ec4f9..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "js2xmlparser", - "description": "Parses JavaScript objects into XML", - "keywords": [ - "convert", - "converter", - "js", - "json", - "object", - "objects", - "parse", - "parser", - "xml" - ], - "homepage": "http://www.kourlas.net", - "version": "0.1.5", - "author": { - "name": "Michael Kourlas", - "email": "michael@kourlas.net" - }, - "main": "./lib/js2xmlparser.js", - "repository": { - "type": "git", - "url": "git://github.com/michaelkourlas/node-js2xmlparser.git" - }, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/michaelkourlas/node-js2xmlparser/issues" - }, - "_id": "js2xmlparser@0.1.5", - "_shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", - "_from": "js2xmlparser@>=0.1.0 <0.2.0", - "_npmVersion": "1.4.9", - "_npmUser": { - "name": "michaelkourlas", - "email": "michael@kourlas.net" - }, - "maintainers": [ - { - "name": "michaelkourlas", - "email": "michaelkourlas@gmail.com" - } - ], - "dist": { - "shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", - "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz" -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/.npmignore b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/.npmignore deleted file mode 100644 index 3fb773c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.git* -test/ diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/LICENSE b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/LICENSE deleted file mode 100644 index a7b812e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/Makefile b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/Makefile deleted file mode 100644 index 20ac2d4..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -all: - @cp lib/marked.js marked.js - @uglifyjs -o marked.min.js marked.js - -clean: - @rm marked.js - @rm marked.min.js - -bench: - @node test --bench - -.PHONY: clean all diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/README.md deleted file mode 100644 index 441c1eb..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/README.md +++ /dev/null @@ -1,386 +0,0 @@ -# marked - -> A full-featured markdown parser and compiler, written in JavaScript. Built -> for speed. - -[![NPM version](https://badge.fury.io/js/marked.png)][badge] - -## Install - -``` bash -npm install marked --save -``` - -## Usage - -Minimal usage: - -```js -var marked = require('marked'); -console.log(marked('I am using __markdown__.')); -// Outputs:

I am using markdown.

-``` - -Example setting options with default values: - -```js -var marked = require('marked'); -marked.setOptions({ - renderer: new marked.Renderer(), - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: true, - smartLists: true, - smartypants: false -}); - -console.log(marked('I am using __markdown__.')); -``` - -## marked(markdownString [,options] [,callback]) - -### markdownString - -Type: `string` - -String of markdown source to be compiled. - -### options - -Type: `object` - -Hash of options. Can also be set using the `marked.setOptions` method as seen -above. - -### callback - -Type: `function` - -Function called when the `markdownString` has been fully parsed when using -async highlighting. If the `options` argument is omitted, this can be used as -the second argument. - -## Options - -### highlight - -Type: `function` - -A function to highlight code blocks. The first example below uses async highlighting with -[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using -[highlight.js][highlight]: - -```js -var marked = require('marked'); - -var markdownString = '```js\n console.log("hello"); \n```'; - -// Async highlighting with pygmentize-bundled -marked.setOptions({ - highlight: function (code, lang, callback) { - require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { - callback(err, result.toString()); - }); - } -}); - -// Using async version of marked -marked(markdownString, function (err, content) { - if (err) throw err; - console.log(content); -}); - -// Synchronous highlighting with highlight.js -marked.setOptions({ - highlight: function (code) { - return require('highlight.js').highlightAuto(code).value; - } -}); - -console.log(marked(markdownString)); -``` - -#### highlight arguments - -`code` - -Type: `string` - -The section of code to pass to the highlighter. - -`lang` - -Type: `string` - -The programming language specified in the code block. - -`callback` - -Type: `function` - -The callback function to call when using an async highlighter. - -### renderer - -Type: `object` -Default: `new Renderer()` - -An object containing functions to render tokens to HTML. - -#### Overriding renderer methods - -The renderer option allows you to render tokens in a custom manor. Here is an -example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: - -```javascript -var marked = require('marked'); -var renderer = new marked.Renderer(); - -renderer.heading = function (text, level) { - var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); - - return '' + - text + ''; -}, - -console.log(marked('# heading+', { renderer: renderer })); -``` -This code will output the following HTML: -```html -

- - - - heading+ -

-``` - -#### Block level renderer methods - -- code(*string* code, *string* language) -- blockquote(*string* quote) -- html(*string* html) -- heading(*string* text, *number* level) -- hr() -- list(*string* body, *boolean* ordered) -- listitem(*string* text) -- paragraph(*string* text) -- table(*string* header, *string* body) -- tablerow(*string* content) -- tablecell(*string* content, *object* flags) - -`flags` has the following properties: - -```js -{ - header: true || false, - align: 'center' || 'left' || 'right' -} -``` - -#### Inline level renderer methods - -- strong(*string* text) -- em(*string* text) -- codespan(*string* code) -- br() -- del(*string* text) -- link(*string* href, *string* title, *string* text) -- image(*string* href, *string* title, *string* text) - -### gfm - -Type: `boolean` -Default: `true` - -Enable [GitHub flavored markdown][gfm]. - -### tables - -Type: `boolean` -Default: `true` - -Enable GFM [tables][tables]. -This option requires the `gfm` option to be true. - -### breaks - -Type: `boolean` -Default: `false` - -Enable GFM [line breaks][breaks]. -This option requires the `gfm` option to be true. - -### pedantic - -Type: `boolean` -Default: `false` - -Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of -the original markdown bugs or poor behavior. - -### sanitize - -Type: `boolean` -Default: `false` - -Sanitize the output. Ignore any HTML that has been input. - -### smartLists - -Type: `boolean` -Default: `true` - -Use smarter list behavior than the original markdown. May eventually be -default with the old behavior moved into `pedantic`. - -### smartypants - -Type: `boolean` -Default: `false` - -Use "smart" typograhic punctuation for things like quotes and dashes. - -## Access to lexer and parser - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -## CLI - -``` bash -$ marked -o hello.html -hello world -^D -$ cat hello.html -

hello world

-``` - -## Philosophy behind marked - -The point of marked was to create a markdown compiler where it was possible to -frequently parse huge chunks of markdown without having to worry about -caching the compiled output somehow...or blocking for an unnecesarily long time. - -marked is very concise and still implements all markdown features. It is also -now fully compatible with the client-side. - -marked more or less passes the official markdown test suite in its -entirety. This is important because a surprising number of markdown compilers -cannot pass more than a few tests. It was very difficult to get marked as -compliant as it is. It could have cut corners in several areas for the sake -of performance, but did not in order to be exactly what you expect in terms -of a markdown rendering. In fact, this is why marked could be considered at a -disadvantage in the benchmarks above. - -Along with implementing every markdown feature, marked also implements [GFM -features][gfmf]. - -## Benchmarks - -node v0.8.x - -``` bash -$ node test --bench -marked completed in 3411ms. -marked (gfm) completed in 3727ms. -marked (pedantic) completed in 3201ms. -robotskirt completed in 808ms. -showdown (reuse converter) completed in 11954ms. -showdown (new converter) completed in 17774ms. -markdown-js completed in 17191ms. -``` - -__Marked is now faster than Discount, which is written in C.__ - -For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. - -### Pro level - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -``` bash -$ node -> require('marked').lexer('> i am using marked.') -[ { type: 'blockquote_start' }, - { type: 'paragraph', - text: 'i am using marked.' }, - { type: 'blockquote_end' }, - links: {} ] -``` - -## Running Tests & Contributing - -If you want to submit a pull request, make sure your changes pass the test -suite. If you're adding a new feature, be sure to add your own test. - -The marked test suite is set up slightly strangely: `test/new` is for all tests -that are not part of the original markdown.pl test suite (this is where your -test should go if you make one). `test/original` is only for the original -markdown.pl tests. `test/tests` houses both types of tests after they have been -combined and moved/generated by running `node test --fix` or `marked --test ---fix`. - -In other words, if you have a test to add, add it to `test/new/` and then -regenerate the tests with `node test --fix`. Commit the result. If your test -uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you -can add `.nogfm` to the filename. So, `my-test.text` becomes -`my-test.nogfm.text`. You can do this with any marked option. Say you want -line breaks and smartypants enabled, your filename should be: -`my-test.breaks.smartypants.text`. - -To run the tests: - -``` bash -cd marked/ -node test -``` - -### Contribution and License Agreement - -If you contribute code to this project, you are implicitly allowing your code -to be distributed under the MIT license. You are also implicitly verifying that -all code is your original work. `` - -## License - -Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) - -See LICENSE for more info. - -[gfm]: https://help.github.com/articles/github-flavored-markdown -[gfmf]: http://github.github.com/github-flavored-markdown/ -[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled -[highlight]: https://github.com/isagalaev/highlight.js -[badge]: http://badge.fury.io/js/marked -[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables -[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/bin/marked b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/bin/marked deleted file mode 100755 index 64254fc..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/bin/marked +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env node - -/** - * Marked CLI - * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) - */ - -var fs = require('fs') - , util = require('util') - , marked = require('../'); - -/** - * Man Page - */ - -function help() { - var spawn = require('child_process').spawn; - - var options = { - cwd: process.cwd(), - env: process.env, - setsid: false, - customFds: [0, 1, 2] - }; - - spawn('man', - [__dirname + '/../man/marked.1'], - options); -} - -/** - * Main - */ - -function main(argv, callback) { - var files = [] - , options = {} - , input - , output - , arg - , tokens - , opt; - - function getarg() { - var arg = argv.shift(); - - if (arg.indexOf('--') === 0) { - // e.g. --opt - arg = arg.split('='); - if (arg.length > 1) { - // e.g. --opt=val - argv.unshift(arg.slice(1).join('=')); - } - arg = arg[0]; - } else if (arg[0] === '-') { - if (arg.length > 2) { - // e.g. -abc - argv = arg.substring(1).split('').map(function(ch) { - return '-' + ch; - }).concat(argv); - arg = argv.shift(); - } else { - // e.g. -a - } - } else { - // e.g. foo - } - - return arg; - } - - while (argv.length) { - arg = getarg(); - switch (arg) { - case '--test': - return require('../test').main(process.argv.slice()); - case '-o': - case '--output': - output = argv.shift(); - break; - case '-i': - case '--input': - input = argv.shift(); - break; - case '-t': - case '--tokens': - tokens = true; - break; - case '-h': - case '--help': - return help(); - default: - if (arg.indexOf('--') === 0) { - opt = camelize(arg.replace(/^--(no-)?/, '')); - if (!marked.defaults.hasOwnProperty(opt)) { - continue; - } - if (arg.indexOf('--no-') === 0) { - options[opt] = typeof marked.defaults[opt] !== 'boolean' - ? null - : false; - } else { - options[opt] = typeof marked.defaults[opt] !== 'boolean' - ? argv.shift() - : true; - } - } else { - files.push(arg); - } - break; - } - } - - function getData(callback) { - if (!input) { - if (files.length <= 2) { - return getStdin(callback); - } - input = files.pop(); - } - return fs.readFile(input, 'utf8', callback); - } - - return getData(function(err, data) { - if (err) return callback(err); - - data = tokens - ? JSON.stringify(marked.lexer(data, options), null, 2) - : marked(data, options); - - if (!output) { - process.stdout.write(data + '\n'); - return callback(); - } - - return fs.writeFile(output, data, callback); - }); -} - -/** - * Helpers - */ - -function getStdin(callback) { - var stdin = process.stdin - , buff = ''; - - stdin.setEncoding('utf8'); - - stdin.on('data', function(data) { - buff += data; - }); - - stdin.on('error', function(err) { - return callback(err); - }); - - stdin.on('end', function() { - return callback(null, buff); - }); - - try { - stdin.resume(); - } catch (e) { - callback(e); - } -} - -function camelize(text) { - return text.replace(/(\w)-(\w)/g, function(_, a, b) { - return a + b.toUpperCase(); - }); -} - -/** - * Expose / Entry Point - */ - -if (!module.parent) { - process.title = 'marked'; - main(process.argv.slice(), function(err, code) { - if (err) throw err; - return process.exit(code || 0); - }); -} else { - module.exports = main; -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/index.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/index.js deleted file mode 100644 index a12f905..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/marked'); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/lib/marked.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/lib/marked.js deleted file mode 100644 index e2f08c9..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/lib/marked.js +++ /dev/null @@ -1,1266 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ - -;(function() { - -/** - * Block-Level Grammar - */ - -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) - (); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -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') + '|') - (); - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, - table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ -}); - -/** - * Block Lexer - */ - -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; - } - } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block; - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); -}; - -/** - * Preprocessing - */ - -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); -}; - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top, bq) { - var src = src.replace(/^ +$/gm, '') - , next - , loose - , cap - , bull - , b - , item - , space - , i - , l; - - while (src) { - // newline - if (cap = this.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - this.tokens.push({ - type: 'space' - }); - } - } - - // code - 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; - } - - // fences (gfm) - 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; - } - - // heading - 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; - } - - // table no leading pipe (gfm) - 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 < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i].split(/ *\| */); - } - - this.tokens.push(item); - - continue; - } - - // lheading - if (cap = this.rules.lheading.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - - // hr - if (cap = this.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = this.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this.token(cap, top, true); - - this.tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - 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 - }); - - // Get each top-level item. - cap = cap[0].match(this.rules.item); - - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (this.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull !== b && !(bull.length > 1 && b.length > 1)) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - 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' - }); - - // Recurse. - this.token(item, false, bq); - - this.tokens.push({ - type: 'list_item_end' - }); - } - - this.tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - 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; - } - - // def - 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; - } - - // table (gfm) - 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 < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i] - .replace(/^ *\| *| *\| *$/g, '') - .split(/ *\| */); - } - - this.tokens.push(item); - - continue; - } - - // top-level paragraph - if (top && (cap = this.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - - if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return this.tokens; -}; - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - 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) - (); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: replace(inline.escape)('])', '~|])')(), - url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, - del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: replace(inline.text) - (']|', '~]|') - ('|', '|https?://|') - () -}); - -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: replace(inline.br)('{2,}', '*')(), - text: replace(inline.gfm.text)('{2,}', '*')() -}); - -/** - * Inline Lexer & Compiler - */ - -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; - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline; - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); -}; - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var out = '' - , link - , text - , href - , cap; - - while (src) { - // escape - if (cap = this.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += cap[1]; - continue; - } - - // autolink - 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; - } - - // url (gfm) - 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; - } - - // tag - 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; - } - - // link - 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; - } - - // reflink, nolink - 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; - } - - // strong - if (cap = this.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[2] || cap[1])); - continue; - } - - // em - if (cap = this.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[2] || cap[1])); - continue; - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.codespan(escape(cap[2], true)); - continue; - } - - // br - if (cap = this.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.del(this.output(cap[1])); - continue; - } - - // text - 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; -}; - -/** - * Compile Link - */ - -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])); -}; - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) return text; - return text - // em-dashes - .replace(/--/g, '\u2014') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -}; - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - var out = '' - , l = text.length - , i = 0 - , ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -}; - -/** - * Renderer - */ - -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 '
  • ' + text + '
  • \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'; -}; - -// span level renderer -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; -}; - -/** - * Parsing & Compiling - */ - -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; -} - -/** - * Static Parse Method - */ - -Parser.parse = function(src, options, renderer) { - var parser = new Parser(options, renderer); - return parser.parse(src); -}; - -/** - * Parse Loop - */ - -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; -}; - -/** - * Next Token - */ - -Parser.prototype.next = function() { - return this.token = this.tokens.pop(); -}; - -/** - * Preview Next Token - */ - -Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; -}; - -/** - * Parse Text Tokens - */ - -Parser.prototype.parseText = function() { - var body = this.token.text; - - while (this.peek().type === 'text') { - body += '\n' + this.next().text; - } - - return this.inline.output(body); -}; - -/** - * Parse Current Token - */ - -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; - - // header - cell = ''; - for (i = 0; i < this.token.header.length; i++) { - flags = { header: true, align: this.token.align[i] }; - cell += this.renderer.tablecell( - this.inline.output(this.token.header[i]), - { header: true, align: this.token.align[i] } - ); - } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this.token.cells[i]; - - cell = ''; - for (j = 0; j < row.length; j++) { - cell += this.renderer.tablecell( - this.inline.output(row[j]), - { header: false, align: this.token.align[j] } - ); - } - - body += this.renderer.tablerow(cell); - } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - var body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this.tok(); - } - - return this.renderer.blockquote(body); - } - case 'list_start': { - var body = '' - , ordered = this.token.ordered; - - while (this.next().type !== 'list_end') { - body += this.tok(); - } - - return this.renderer.list(body, ordered); - } - case 'list_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.token.type === 'text' - ? this.parseText() - : this.tok(); - } - - return this.renderer.listitem(body); - } - case 'loose_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.tok(); - } - - return this.renderer.listitem(body); - } - case 'html': { - var html = !this.token.pre && !this.options.pedantic - ? this.inline.output(this.token.text) - : this.token.text; - return this.renderer.html(html); - } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); - } - case 'text': { - return this.renderer.paragraph(this.parseText()); - } - } -}; - -/** - * Helpers - */ - -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//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 (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - - -/** - * Marked - */ - -function marked(src, opt, callback) { - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight - , tokens - , pending - , i = 0; - - try { - tokens = Lexer.lex(src, opt) - } catch (e) { - return callback(e); - } - - pending = tokens.length; - - var done = function() { - var out, err; - - try { - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) return done(); - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { - return --pending || done(); - } - return highlight(token.text, token.lang, function(err, code) { - if (code == null || code === token.text) { - return --pending || done(); - } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); - } - - return; - } - try { - if (opt) opt = merge({}, marked.defaults, opt); - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/chjj/marked.'; - if ((opt || marked.defaults).silent) { - return '

    An error occured:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } -} - -/** - * Options - */ - -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 -}; - -/** - * Expose - */ - -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 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); -}()); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/man/marked.1 b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/man/marked.1 deleted file mode 100644 index f89f1a7..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/man/marked.1 +++ /dev/null @@ -1,88 +0,0 @@ -.ds q \N'34' -.TH marked 1 "2014-01-31" "v0.3.1" "marked.js" - -.SH NAME -marked \- a javascript markdown parser - -.SH SYNOPSIS -.B marked -[\-o \fI\fP] [\-i \fI\fP] [\-\-help] -[\-\-tokens] [\-\-pedantic] [\-\-gfm] -[\-\-breaks] [\-\-tables] [\-\-sanitize] -[\-\-smart\-lists] [\-\-lang\-prefix \fI\fP] -[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP] - -.SH DESCRIPTION -.B marked -is a full-featured javascript markdown parser, built for speed. It also includes -multiple GFM features. - -.SH EXAMPLES -.TP -cat in.md | marked > out.html -.TP -echo "hello *world*" | marked -.TP -marked \-o out.html in.md \-\-gfm -.TP -marked \-\-output="hello world.html" \-i in.md \-\-no-breaks - -.SH OPTIONS -.TP -.BI \-o,\ \-\-output\ [\fIoutput\fP] -Specify file output. If none is specified, write to stdout. -.TP -.BI \-i,\ \-\-input\ [\fIinput\fP] -Specify file input, otherwise use last argument as input file. If no input file -is specified, read from stdin. -.TP -.BI \-t,\ \-\-tokens -Output a token stream instead of html. -.TP -.BI \-\-pedantic -Conform to obscure parts of markdown.pl as much as possible. Don't fix original -markdown bugs. -.TP -.BI \-\-gfm -Enable github flavored markdown. -.TP -.BI \-\-breaks -Enable GFM line breaks. Only works with the gfm option. -.TP -.BI \-\-tables -Enable GFM tables. Only works with the gfm option. -.TP -.BI \-\-sanitize -Sanitize output. Ignore any HTML input. -.TP -.BI \-\-smart\-lists -Use smarter list behavior than the original markdown. -.TP -.BI \-\-lang\-prefix\ [\fIprefix\fP] -Set the prefix for code block classes. -.TP -.BI \-\-no\-sanitize,\ \-no-etc... -The inverse of any of the marked options above. -.TP -.BI \-\-silent -Silence error output. -.TP -.BI \-h,\ \-\-help -Display help information. - -.SH CONFIGURATION -For configuring and running programmatically. - -.B Example - - require('marked')('*foo*', { gfm: true }); - -.SH BUGS -Please report any bugs to https://github.com/chjj/marked. - -.SH LICENSE -Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). - -.SH "SEE ALSO" -.BR markdown(1), -.BR node.js(1) diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/package.json b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/package.json deleted file mode 100644 index e225de6..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "marked", - "description": "A markdown parser built for speed", - "author": { - "name": "Christopher Jeffrey" - }, - "version": "0.3.2", - "main": "./lib/marked.js", - "bin": { - "marked": "./bin/marked" - }, - "man": [ - "./man/marked.1" - ], - "preferGlobal": true, - "repository": { - "type": "git", - "url": "git://github.com/chjj/marked.git" - }, - "homepage": "https://github.com/chjj/marked", - "bugs": { - "url": "http://github.com/chjj/marked/issues" - }, - "license": "MIT", - "keywords": [ - "markdown", - "markup", - "html" - ], - "tags": [ - "markdown", - "markup", - "html" - ], - "devDependencies": { - "markdown": "*", - "showdown": "*", - "robotskirt": "*" - }, - "scripts": { - "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 <0.4.0", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "chjj", - "email": "chjjeffrey@gmail.com" - }, - "maintainers": [ - { - "name": "chjj", - "email": "chjjeffrey@gmail.com" - } - ], - "directories": {}, - "_shasum": "015db158864438f24a64bdd61a0428b418706d09", - "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/README.md deleted file mode 100644 index 52d14a3..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/README.md +++ /dev/null @@ -1 +0,0 @@ -See [http://taffydb.com](http://taffydb.com). \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/package.json b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/package.json deleted file mode 100644 index 1165f20..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "taffydb", - "version": "2.6.2", - "description": "An open-source library that brings database features into your JavaScript applications.", - "main": "taffy.js", - "repository": { - "type": "git", - "url": "git://github.com/hegemonic/taffydb.git" - }, - "license": "BSD", - "readme": "See [http://taffydb.com](http://taffydb.com).", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hegemonic/taffydb/issues" - }, - "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" -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/taffy-test.html b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/taffy-test.html deleted file mode 100644 index c4df78b..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/taffy-test.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - taffy test - - - - - - -
    -Please open your javascript console to see test results -
    - - - - diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/taffy.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/taffy.js deleted file mode 100644 index b7ad88c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/taffydb/taffy.js +++ /dev/null @@ -1,1973 +0,0 @@ -/* - - Software License Agreement (BSD License) - http://taffydb.com - Copyright (c) - All rights reserved. - - - Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following condition is met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - */ - -/*jslint browser : true, continue : true, - devel : true, indent : 2, maxerr : 500, - newcap : true, nomen : true, plusplus : true, - regexp : true, sloppy : true, vars : false, - white : true -*/ - -// BUILD 193d48d, modified by mmikowski to pass jslint - -// Setup TAFFY name space to return an object with methods -var TAFFY, exports, T; -(function () { - 'use strict'; - var - typeList, makeTest, idx, typeKey, - version, TC, idpad, cmax, - API, protectJSON, each, eachin, - isIndexable, returnFilter, runFilters, - numcharsplit, orderByCol, run - ; - - - if ( ! TAFFY ){ - // TC = Counter for Taffy DBs on page, used for unique IDs - // cmax = size of charnumarray conversion cache - // idpad = zeros to pad record IDs with - version = '2.6.2'; // proposed mmikowski 2012-08-06 - TC = 1; - idpad = '000000'; - cmax = 1000; - API = {}; - - protectJSON = function ( t ) { - // **************************************** - // * - // * Takes: a variable - // * Returns: the variable if object/array or the parsed variable if JSON - // * - // **************************************** - if ( TAFFY.isArray( t ) || TAFFY.isObject( t ) ){ - return t; - } - else { - return JSON.parse( t ); - } - }; - - each = function ( a, fun, u ) { - var r, i, x, y; - // **************************************** - // * - // * Takes: - // * a = an object/value or an array of objects/values - // * f = a function - // * u = optional flag to describe how to handle undefined values - // in array of values. True: pass them to the functions, - // False: skip. Default False; - // * Purpose: Used to loop over arrays - // * - // **************************************** - if ( a && ((T.isArray( a ) && a.length === 1) || (!T.isArray( a ))) ){ - fun( (T.isArray( a )) ? a[0] : a, 0 ); - } - else { - for ( r, i, x = 0, a = (T.isArray( a )) ? a : [a], y = a.length; - x < y; x++ ) - { - i = a[x]; - if ( !T.isUndefined( i ) || (u || false) ){ - r = fun( i, x ); - if ( r === T.EXIT ){ - break; - } - - } - } - } - }; - - eachin = function ( o, fun ) { - // **************************************** - // * - // * Takes: - // * o = an object - // * f = a function - // * Purpose: Used to loop over objects - // * - // **************************************** - var x = 0, r, i; - - for ( i in o ){ - if ( o.hasOwnProperty( i ) ){ - r = fun( o[i], i, x++ ); - if ( r === T.EXIT ){ - break; - } - } - } - - }; - - API.extend = function ( m, f ) { - // **************************************** - // * - // * Takes: method name, function - // * Purpose: Add a custom method to the API - // * - // **************************************** - API[m] = function () { - return f.apply( this, arguments ); - }; - }; - - isIndexable = function ( f ) { - var i; - // Check to see if record ID - if ( T.isString( f ) && /[t][0-9]*[r][0-9]*/i.test( f ) ){ - return true; - } - // Check to see if record - if ( T.isObject( f ) && f.___id && f.___s ){ - return true; - } - - // Check to see if array of indexes - if ( T.isArray( f ) ){ - i = true; - each( f, function ( r ) { - if ( !isIndexable( r ) ){ - i = false; - - return TAFFY.EXIT; - } - }); - return i; - } - - return false; - }; - - runFilters = function ( r, filter ) { - // **************************************** - // * - // * Takes: takes a record and a collection of filters - // * Returns: true if the record matches, false otherwise - // **************************************** - var match = true; - - - each( filter, function ( mf ) { - switch ( T.typeOf( mf ) ){ - case 'function': - // run function - if ( !mf.apply( r ) ){ - match = false; - return TAFFY.EXIT; - } - break; - case 'array': - // loop array and treat like a SQL or - match = (mf.length === 1) ? (runFilters( r, mf[0] )) : - (mf.length === 2) ? (runFilters( r, mf[0] ) || - runFilters( r, mf[1] )) : - (mf.length === 3) ? (runFilters( r, mf[0] ) || - runFilters( r, mf[1] ) || runFilters( r, mf[2] )) : - (mf.length === 4) ? (runFilters( r, mf[0] ) || - runFilters( r, mf[1] ) || runFilters( r, mf[2] ) || - runFilters( r, mf[3] )) : false; - if ( mf.length > 4 ){ - each( mf, function ( f ) { - if ( runFilters( r, f ) ){ - match = true; - } - }); - } - break; - } - }); - - return match; - }; - - returnFilter = function ( f ) { - // **************************************** - // * - // * Takes: filter object - // * Returns: a filter function - // * Purpose: Take a filter object and return a function that can be used to compare - // * a TaffyDB record to see if the record matches a query - // **************************************** - var nf = []; - if ( T.isString( f ) && /[t][0-9]*[r][0-9]*/i.test( f ) ){ - f = { ___id : f }; - } - if ( T.isArray( f ) ){ - // if we are working with an array - - each( f, function ( r ) { - // loop the array and return a filter func for each value - nf.push( returnFilter( r ) ); - }); - // now build a func to loop over the filters and return true if ANY of the filters match - // This handles logical OR expressions - f = function () { - var that = this, match = false; - each( nf, function ( f ) { - if ( runFilters( that, f ) ){ - match = true; - } - }); - return match; - }; - return f; - - } - // if we are dealing with an Object - if ( T.isObject( f ) ){ - if ( T.isObject( f ) && f.___id && f.___s ){ - f = { ___id : f.___id }; - } - - // Loop over each value on the object to prep match type and match value - eachin( f, function ( v, i ) { - - // default match type to IS/Equals - if ( !T.isObject( v ) ){ - v = { - 'is' : v - }; - } - // loop over each value on the value object - if any - eachin( v, function ( mtest, s ) { - // s = match type, e.g. is, hasAll, like, etc - var c = [], looper; - - // function to loop and apply filter - looper = (s === 'hasAll') ? - function ( mtest, func ) { - func( mtest ); - } : each; - - // loop over each test - looper( mtest, function ( mtest ) { - - // su = match success - // f = match false - var su = true, f = false, matchFunc; - - - // push a function onto the filter collection to do the matching - matchFunc = function () { - - // get the value from the record - var - mvalue = this[i], - eqeq = '==', - bangeq = '!=', - eqeqeq = '===', - lt = '<', - gt = '>', - lteq = '<=', - gteq = '>=', - bangeqeq = '!==', - r - ; - - - if ( (s.indexOf( '!' ) === 0) && s !== bangeq && - s !== bangeqeq ) - { - // if the filter name starts with ! as in '!is' then reverse the match logic and remove the ! - su = false; - s = s.substring( 1, s.length ); - } - // get the match results based on the s/match type - /*jslint eqeq : true */ - r = ( - (s === 'regex') ? (mtest.test( mvalue )) : (s === 'lt' || s === lt) - ? (mvalue < mtest) : (s === 'gt' || s === gt) - ? (mvalue > mtest) : (s === 'lte' || s === lteq) - ? (mvalue <= mtest) : (s === 'gte' || s === gteq) - ? (mvalue >= mtest) : (s === 'left') - ? (mvalue.indexOf( mtest ) === 0) : (s === 'leftnocase') - ? (mvalue.toLowerCase().indexOf( mtest.toLowerCase() ) - === 0) : (s === 'right') - ? (mvalue.substring( (mvalue.length - mtest.length) ) - === mtest) : (s === 'rightnocase') - ? (mvalue.toLowerCase().substring( - (mvalue.length - mtest.length) ) === mtest.toLowerCase()) - : (s === 'like') - ? (mvalue.indexOf( mtest ) >= 0) : (s === 'likenocase') - ? (mvalue.toLowerCase().indexOf(mtest.toLowerCase()) >= 0) - : (s === eqeqeq || s === 'is') - ? (mvalue === mtest) : (s === eqeq) - ? (mvalue == mtest) : (s === bangeqeq) - ? (mvalue !== mtest) : (s === bangeq) - ? (mvalue != mtest) : (s === 'isnocase') - ? (mvalue.toLowerCase - ? mvalue.toLowerCase() === mtest.toLowerCase() - : mvalue === mtest) : (s === 'has') - ? (T.has( mvalue, mtest )) : (s === 'hasall') - ? (T.hasAll( mvalue, mtest )) : ( - s.indexOf( 'is' ) === -1 - && !TAFFY.isNull( mvalue ) - && !TAFFY.isUndefined( mvalue ) - && !TAFFY.isObject( mtest ) - && !TAFFY.isArray( mtest ) - ) - ? (mtest === mvalue[s]) - : (T[s] && T.isFunction( T[s] ) - && s.indexOf( 'is' ) === 0) - ? T[s]( mvalue ) === mtest - : (T[s] && T.isFunction( T[s] )) - ? T[s]( mvalue, mtest ) : (false) - ); - /*jslint eqeq : false */ - r = (r && !su) ? false : (!r && !su) ? true : r; - - return r; - }; - c.push( matchFunc ); - - }); - // if only one filter in the collection push it onto the filter list without the array - if ( c.length === 1 ){ - - nf.push( c[0] ); - } - else { - // else build a function to loop over all the filters and return true only if ALL match - // this is a logical AND - nf.push( function () { - var that = this, match = false; - each( c, function ( f ) { - if ( f.apply( that ) ){ - match = true; - } - }); - return match; - }); - } - }); - }); - // finally return a single function that wraps all the other functions and will run a query - // where all functions have to return true for a record to appear in a query result - f = function () { - var that = this, match = true; - // faster if less than 4 functions - match = (nf.length === 1 && !nf[0].apply( that )) ? false : - (nf.length === 2 && - (!nf[0].apply( that ) || !nf[1].apply( that ))) ? false : - (nf.length === 3 && - (!nf[0].apply( that ) || !nf[1].apply( that ) || - !nf[2].apply( that ))) ? false : - (nf.length === 4 && - (!nf[0].apply( that ) || !nf[1].apply( that ) || - !nf[2].apply( that ) || !nf[3].apply( that ))) ? false - : true; - if ( nf.length > 4 ){ - each( nf, function ( f ) { - if ( !runFilters( that, f ) ){ - match = false; - } - }); - } - return match; - }; - return f; - } - - // if function - if ( T.isFunction( f ) ){ - return f; - } - }; - - orderByCol = function ( ar, o ) { - // **************************************** - // * - // * Takes: takes an array and a sort object - // * Returns: the array sorted - // * Purpose: Accept filters such as "[col], [col2]" or "[col] desc" and sort on those columns - // * - // **************************************** - - var sortFunc = function ( a, b ) { - // function to pass to the native array.sort to sort an array - var r = 0; - - T.each( o, function ( sd ) { - // loop over the sort instructions - // get the column name - var o, col, dir, c, d; - o = sd.split( ' ' ); - col = o[0]; - - // get the direction - dir = (o.length === 1) ? "logical" : o[1]; - - - if ( dir === 'logical' ){ - // if dir is logical than grab the charnum arrays for the two values we are looking at - c = numcharsplit( a[col] ); - d = numcharsplit( b[col] ); - // loop over the charnumarrays until one value is higher than the other - T.each( (c.length <= d.length) ? c : d, function ( x, i ) { - if ( c[i] < d[i] ){ - r = -1; - return TAFFY.EXIT; - } - else if ( c[i] > d[i] ){ - r = 1; - return TAFFY.EXIT; - } - } ); - } - else if ( dir === 'logicaldesc' ){ - // if logicaldesc than grab the charnum arrays for the two values we are looking at - c = numcharsplit( a[col] ); - d = numcharsplit( b[col] ); - // loop over the charnumarrays until one value is lower than the other - T.each( (c.length <= d.length) ? c : d, function ( x, i ) { - if ( c[i] > d[i] ){ - r = -1; - return TAFFY.EXIT; - } - else if ( c[i] < d[i] ){ - r = 1; - return TAFFY.EXIT; - } - } ); - } - else if ( dir === 'asec' && a[col] < b[col] ){ - // if asec - default - check to see which is higher - r = -1; - return T.EXIT; - } - else if ( dir === 'asec' && a[col] > b[col] ){ - // if asec - default - check to see which is higher - r = 1; - return T.EXIT; - } - else if ( dir === 'desc' && a[col] > b[col] ){ - // if desc check to see which is lower - r = -1; - return T.EXIT; - - } - else if ( dir === 'desc' && a[col] < b[col] ){ - // if desc check to see which is lower - r = 1; - return T.EXIT; - - } - // if r is still 0 and we are doing a logical sort than look to see if one array is longer than the other - if ( r === 0 && dir === 'logical' && c.length < d.length ){ - r = -1; - } - else if ( r === 0 && dir === 'logical' && c.length > d.length ){ - r = 1; - } - else if ( r === 0 && dir === 'logicaldesc' && c.length > d.length ){ - r = -1; - } - else if ( r === 0 && dir === 'logicaldesc' && c.length < d.length ){ - r = 1; - } - - if ( r !== 0 ){ - return T.EXIT; - } - - - } ); - return r; - }; - // call the sort function and return the newly sorted array - return (ar && ar.push) ? ar.sort( sortFunc ) : ar; - - - }; - - // **************************************** - // * - // * Takes: a string containing numbers and letters and turn it into an array - // * Returns: return an array of numbers and letters - // * Purpose: Used for logical sorting. String Example: 12ABC results: [12,'ABC'] - // **************************************** - (function () { - // creates a cache for numchar conversions - var cache = {}, cachcounter = 0; - // creates the numcharsplit function - numcharsplit = function ( thing ) { - // if over 1000 items exist in the cache, clear it and start over - if ( cachcounter > cmax ){ - cache = {}; - cachcounter = 0; - } - - // if a cache can be found for a numchar then return its array value - return cache['_' + thing] || (function () { - // otherwise do the conversion - // make sure it is a string and setup so other variables - var nthing = String( thing ), - na = [], - rv = '_', - rt = '', - x, xx, c; - - // loop over the string char by char - for ( x = 0, xx = nthing.length; x < xx; x++ ){ - // take the char at each location - c = nthing.charCodeAt( x ); - // check to see if it is a valid number char and append it to the array. - // if last char was a string push the string to the charnum array - if ( ( c >= 48 && c <= 57 ) || c === 46 ){ - if ( rt !== 'n' ){ - rt = 'n'; - na.push( rv.toLowerCase() ); - rv = ''; - } - rv = rv + nthing.charAt( x ); - } - else { - // check to see if it is a valid string char and append to string - // if last char was a number push the whole number to the charnum array - if ( rt !== 's' ){ - rt = 's'; - na.push( parseFloat( rv ) ); - rv = ''; - } - rv = rv + nthing.charAt( x ); - } - } - // once done, push the last value to the charnum array and remove the first uneeded item - na.push( (rt === 'n') ? parseFloat( rv ) : rv.toLowerCase() ); - na.shift(); - // add to cache - cache['_' + thing] = na; - cachcounter++; - // return charnum array - return na; - }()); - }; - }()); - - // **************************************** - // * - // * Runs a query - // **************************************** - - - run = function () { - this.context( { - results : this.getDBI().query( this.context() ) - }); - - }; - - API.extend( 'filter', function () { - // **************************************** - // * - // * Takes: takes unlimited filter objects as arguments - // * Returns: method collection - // * Purpose: Take filters as objects and cache functions for later lookup when a query is run - // **************************************** - var - nc = TAFFY.mergeObj( this.context(), { run : null } ), - nq = [] - ; - each( nc.q, function ( v ) { - nq.push( v ); - }); - nc.q = nq; - // Hadnle passing of ___ID or a record on lookup. - each( arguments, function ( f ) { - nc.q.push( returnFilter( f ) ); - nc.filterRaw.push( f ); - }); - - return this.getroot( nc ); - }); - - API.extend( 'order', function ( o ) { - // **************************************** - // * - // * Purpose: takes a string and creates an array of order instructions to be used with a query - // **************************************** - - o = o.split( ',' ); - var x = [], nc; - - each( o, function ( r ) { - x.push( r.replace( /^\s*/, '' ).replace( /\s*$/, '' ) ); - }); - - nc = TAFFY.mergeObj( this.context(), {sort : null} ); - nc.order = x; - - return this.getroot( nc ); - }); - - API.extend( 'limit', function ( n ) { - // **************************************** - // * - // * Purpose: takes a limit number to limit the number of rows returned by a query. Will update the results - // * of a query - // **************************************** - var nc = TAFFY.mergeObj( this.context(), {}), - limitedresults - ; - - nc.limit = n; - - if ( nc.run && nc.sort ){ - limitedresults = []; - each( nc.results, function ( i, x ) { - if ( (x + 1) > n ){ - return TAFFY.EXIT; - } - limitedresults.push( i ); - }); - nc.results = limitedresults; - } - - return this.getroot( nc ); - }); - - API.extend( 'start', function ( n ) { - // **************************************** - // * - // * Purpose: takes a limit number to limit the number of rows returned by a query. Will update the results - // * of a query - // **************************************** - var nc = TAFFY.mergeObj( this.context(), {} ), - limitedresults - ; - - nc.start = n; - - if ( nc.run && nc.sort && !nc.limit ){ - limitedresults = []; - each( nc.results, function ( i, x ) { - if ( (x + 1) > n ){ - limitedresults.push( i ); - } - }); - nc.results = limitedresults; - } - else { - nc = TAFFY.mergeObj( this.context(), {run : null, start : n} ); - } - - return this.getroot( nc ); - }); - - API.extend( 'update', function ( arg0, arg1, arg2 ) { - // **************************************** - // * - // * Takes: a object and passes it off DBI update method for all matched records - // **************************************** - var runEvent = true, o = {}, args = arguments, that; - if ( TAFFY.isString( arg0 ) && - (arguments.length === 2 || arguments.length === 3) ) - { - o[arg0] = arg1; - if ( arguments.length === 3 ){ - runEvent = arg2; - } - } - else { - o = arg0; - if ( args.length === 2 ){ - runEvent = arg1; - } - } - - that = this; - run.call( this ); - each( this.context().results, function ( r ) { - var c = o; - if ( TAFFY.isFunction( c ) ){ - c = c.apply( TAFFY.mergeObj( r, {} ) ); - } - else { - if ( T.isFunction( c ) ){ - c = c( TAFFY.mergeObj( r, {} ) ); - } - } - if ( TAFFY.isObject( c ) ){ - that.getDBI().update( r.___id, c, runEvent ); - } - }); - if ( this.context().results.length ){ - this.context( { run : null }); - } - return this; - }); - API.extend( 'remove', function ( runEvent ) { - // **************************************** - // * - // * Purpose: removes records from the DB via the remove and removeCommit DBI methods - // **************************************** - var that = this, c = 0; - run.call( this ); - each( this.context().results, function ( r ) { - that.getDBI().remove( r.___id ); - c++; - }); - if ( this.context().results.length ){ - this.context( { - run : null - }); - that.getDBI().removeCommit( runEvent ); - } - - return c; - }); - - - API.extend( 'count', function () { - // **************************************** - // * - // * Returns: The length of a query result - // **************************************** - run.call( this ); - return this.context().results.length; - }); - - API.extend( 'callback', function ( f, delay ) { - // **************************************** - // * - // * Returns null; - // * Runs a function on return of run.call - // **************************************** - if ( f ){ - var that = this; - setTimeout( function () { - run.call( that ); - f.call( that.getroot( that.context() ) ); - }, delay || 0 ); - } - - - return null; - }); - - API.extend( 'get', function () { - // **************************************** - // * - // * Returns: An array of all matching records - // **************************************** - run.call( this ); - return this.context().results; - }); - - API.extend( 'stringify', function () { - // **************************************** - // * - // * Returns: An JSON string of all matching records - // **************************************** - return JSON.stringify( this.get() ); - }); - API.extend( 'first', function () { - // **************************************** - // * - // * Returns: The first matching record - // **************************************** - run.call( this ); - return this.context().results[0] || false; - }); - API.extend( 'last', function () { - // **************************************** - // * - // * Returns: The last matching record - // **************************************** - run.call( this ); - return this.context().results[this.context().results.length - 1] || - false; - }); - - - API.extend( 'sum', function () { - // **************************************** - // * - // * Takes: column to sum up - // * Returns: Sums the values of a column - // **************************************** - var total = 0, that = this; - run.call( that ); - each( arguments, function ( c ) { - each( that.context().results, function ( r ) { - total = total + r[c]; - }); - }); - return total; - }); - - API.extend( 'min', function ( c ) { - // **************************************** - // * - // * Takes: column to find min - // * Returns: the lowest value - // **************************************** - var lowest = null; - run.call( this ); - each( this.context().results, function ( r ) { - if ( lowest === null || r[c] < lowest ){ - lowest = r[c]; - } - }); - return lowest; - }); - - // Taffy innerJoin Extension (OCD edition) - // ======================================= - // - // How to Use - // ********** - // - // left_table.innerJoin( right_table, condition1 <,... conditionN> ) - // - // A condition can take one of 2 forms: - // - // 1. An ARRAY with 2 or 3 values: - // A column name from the left table, an optional comparison string, - // and column name from the right table. The condition passes if the test - // indicated is true. If the condition string is omitted, '===' is assumed. - // EXAMPLES: [ 'last_used_time', '>=', 'current_use_time' ], [ 'user_id','id' ] - // - // 2. A FUNCTION: - // The function receives a left table row and right table row during the - // cartesian join. If the function returns true for the rows considered, - // the merged row is included in the result set. - // EXAMPLE: function (l,r){ return l.name === r.label; } - // - // Conditions are considered in the order they are presented. Therefore the best - // performance is realized when the least expensive and highest prune-rate - // conditions are placed first, since if they return false Taffy skips any - // further condition tests. - // - // Other notes - // *********** - // - // This code passes jslint with the exception of 2 warnings about - // the '==' and '!=' lines. We can't do anything about that short of - // deleting the lines. - // - // Credits - // ******* - // - // Heavily based upon the work of Ian Toltz. - // Revisions to API by Michael Mikowski. - // Code convention per standards in http://manning.com/mikowski - (function () { - var innerJoinFunction = (function () { - var fnCompareList, fnCombineRow, fnMain; - - fnCompareList = function ( left_row, right_row, arg_list ) { - var data_lt, data_rt, op_code, error; - - if ( arg_list.length === 2 ){ - data_lt = left_row[arg_list[0]]; - op_code = '==='; - data_rt = right_row[arg_list[1]]; - } - else { - data_lt = left_row[arg_list[0]]; - op_code = arg_list[1]; - data_rt = right_row[arg_list[2]]; - } - - /*jslint eqeq : true */ - switch ( op_code ){ - case '===' : - return data_lt === data_rt; - case '!==' : - return data_lt !== data_rt; - case '<' : - return data_lt < data_rt; - case '>' : - return data_lt > data_rt; - case '<=' : - return data_lt <= data_rt; - case '>=' : - return data_lt >= data_rt; - case '==' : - return data_lt == data_rt; - case '!=' : - return data_lt != data_rt; - default : - throw String( op_code ) + ' is not supported'; - } - // 'jslint eqeq : false' here results in - // "Unreachable '/*jslint' after 'return'". - // We don't need it though, as the rule exception - // is discarded at the end of this functional scope - }; - - fnCombineRow = function ( left_row, right_row ) { - var out_map = {}, i, prefix; - - for ( i in left_row ){ - if ( left_row.hasOwnProperty( i ) ){ - out_map[i] = left_row[i]; - } - } - for ( i in right_row ){ - if ( right_row.hasOwnProperty( i ) && i !== '___id' && - i !== '___s' ) - { - prefix = !TAFFY.isUndefined( out_map[i] ) ? 'right_' : ''; - out_map[prefix + String( i ) ] = right_row[i]; - } - } - return out_map; - }; - - fnMain = function ( table ) { - var - right_table, i, - arg_list = arguments, - arg_length = arg_list.length, - result_list = [] - ; - - if ( typeof table.filter !== 'function' ){ - if ( table.TAFFY ){ right_table = table(); } - else { - throw 'TAFFY DB or result not supplied'; - } - } - else { right_table = table; } - - this.context( { - results : this.getDBI().query( this.context() ) - } ); - - TAFFY.each( this.context().results, function ( left_row ) { - right_table.each( function ( right_row ) { - var arg_data, is_ok = true; - CONDITION: - for ( i = 1; i < arg_length; i++ ){ - arg_data = arg_list[i]; - if ( typeof arg_data === 'function' ){ - is_ok = arg_data( left_row, right_row ); - } - else if ( typeof arg_data === 'object' && arg_data.length ){ - is_ok = fnCompareList( left_row, right_row, arg_data ); - } - else { - is_ok = false; - } - - if ( !is_ok ){ break CONDITION; } // short circuit - } - - if ( is_ok ){ - result_list.push( fnCombineRow( left_row, right_row ) ); - } - } ); - } ); - return TAFFY( result_list )(); - }; - - return fnMain; - }()); - - API.extend( 'join', innerJoinFunction ); - }()); - - API.extend( 'max', function ( c ) { - // **************************************** - // * - // * Takes: column to find max - // * Returns: the highest value - // **************************************** - var highest = null; - run.call( this ); - each( this.context().results, function ( r ) { - if ( highest === null || r[c] > highest ){ - highest = r[c]; - } - }); - return highest; - }); - - API.extend( 'select', function () { - // **************************************** - // * - // * Takes: columns to select values into an array - // * Returns: array of values - // * Note if more than one column is given an array of arrays is returned - // **************************************** - - var ra = [], args = arguments; - run.call( this ); - if ( arguments.length === 1 ){ - - each( this.context().results, function ( r ) { - - ra.push( r[args[0]] ); - }); - } - else { - each( this.context().results, function ( r ) { - var row = []; - each( args, function ( c ) { - row.push( r[c] ); - }); - ra.push( row ); - }); - } - return ra; - }); - API.extend( 'distinct', function () { - // **************************************** - // * - // * Takes: columns to select unique alues into an array - // * Returns: array of values - // * Note if more than one column is given an array of arrays is returned - // **************************************** - var ra = [], args = arguments; - run.call( this ); - if ( arguments.length === 1 ){ - - each( this.context().results, function ( r ) { - var v = r[args[0]], dup = false; - each( ra, function ( d ) { - if ( v === d ){ - dup = true; - return TAFFY.EXIT; - } - }); - if ( !dup ){ - ra.push( v ); - } - }); - } - else { - each( this.context().results, function ( r ) { - var row = [], dup = false; - each( args, function ( c ) { - row.push( r[c] ); - }); - each( ra, function ( d ) { - var ldup = true; - each( args, function ( c, i ) { - if ( row[i] !== d[i] ){ - ldup = false; - return TAFFY.EXIT; - } - }); - if ( ldup ){ - dup = true; - return TAFFY.EXIT; - } - }); - if ( !dup ){ - ra.push( row ); - } - }); - } - return ra; - }); - API.extend( 'supplant', function ( template, returnarray ) { - // **************************************** - // * - // * Takes: a string template formated with key to be replaced with values from the rows, flag to determine if we want array of strings - // * Returns: array of values or a string - // **************************************** - var ra = []; - run.call( this ); - each( this.context().results, function ( r ) { - // TODO: The curly braces used to be unescaped - ra.push( template.replace( /\{([^\{\}]*)\}/g, function ( a, b ) { - var v = r[b]; - return typeof v === 'string' || typeof v === 'number' ? v : a; - } ) ); - }); - return (!returnarray) ? ra.join( "" ) : ra; - }); - - - API.extend( 'each', function ( m ) { - // **************************************** - // * - // * Takes: a function - // * Purpose: loops over every matching record and applies the function - // **************************************** - run.call( this ); - each( this.context().results, m ); - return this; - }); - API.extend( 'map', function ( m ) { - // **************************************** - // * - // * Takes: a function - // * Purpose: loops over every matching record and applies the function, returing the results in an array - // **************************************** - var ra = []; - run.call( this ); - each( this.context().results, function ( r ) { - ra.push( m( r ) ); - }); - return ra; - }); - - - - T = function ( d ) { - // **************************************** - // * - // * T is the main TAFFY object - // * Takes: an array of objects or JSON - // * Returns a new TAFFYDB - // **************************************** - var TOb = [], - ID = {}, - RC = 1, - settings = { - template : false, - onInsert : false, - onUpdate : false, - onRemove : false, - onDBChange : false, - storageName : false, - forcePropertyCase : null, - cacheSize : 100, - name : '' - }, - dm = new Date(), - CacheCount = 0, - CacheClear = 0, - Cache = {}, - DBI, runIndexes, root - ; - // **************************************** - // * - // * TOb = this database - // * ID = collection of the record IDs and locations within the DB, used for fast lookups - // * RC = record counter, used for creating IDs - // * settings.template = the template to merge all new records with - // * settings.onInsert = event given a copy of the newly inserted record - // * settings.onUpdate = event given the original record, the changes, and the new record - // * settings.onRemove = event given the removed record - // * settings.forcePropertyCase = on insert force the proprty case to be lower or upper. default lower, null/undefined will leave case as is - // * dm = the modify date of the database, used for query caching - // **************************************** - - - runIndexes = function ( indexes ) { - // **************************************** - // * - // * Takes: a collection of indexes - // * Returns: collection with records matching indexed filters - // **************************************** - - var records = [], UniqueEnforce = false; - - if ( indexes.length === 0 ){ - return TOb; - } - - each( indexes, function ( f ) { - // Check to see if record ID - if ( T.isString( f ) && /[t][0-9]*[r][0-9]*/i.test( f ) && - TOb[ID[f]] ) - { - records.push( TOb[ID[f]] ); - UniqueEnforce = true; - } - // Check to see if record - if ( T.isObject( f ) && f.___id && f.___s && - TOb[ID[f.___id]] ) - { - records.push( TOb[ID[f.___id]] ); - UniqueEnforce = true; - } - // Check to see if array of indexes - if ( T.isArray( f ) ){ - each( f, function ( r ) { - each( runIndexes( r ), function ( rr ) { - records.push( rr ); - }); - - }); - } - }); - if ( UniqueEnforce && records.length > 1 ){ - records = []; - } - - return records; - }; - - DBI = { - // **************************************** - // * - // * The DBI is the internal DataBase Interface that interacts with the data - // **************************************** - dm : function ( nd ) { - // **************************************** - // * - // * Takes: an optional new modify date - // * Purpose: used to get and set the DB modify date - // **************************************** - if ( nd ){ - dm = nd; - Cache = {}; - CacheCount = 0; - CacheClear = 0; - } - if ( settings.onDBChange ){ - setTimeout( function () { - settings.onDBChange.call( TOb ); - }, 0 ); - } - if ( settings.storageName ){ - setTimeout( function () { - localStorage.setItem( 'taffy_' + settings.storageName, - JSON.stringify( TOb ) ); - }); - } - return dm; - }, - insert : function ( i, runEvent ) { - // **************************************** - // * - // * Takes: a new record to insert - // * Purpose: merge the object with the template, add an ID, insert into DB, call insert event - // **************************************** - var columns = [], - records = [], - input = protectJSON( i ) - ; - each( input, function ( v, i ) { - var nv, o; - if ( T.isArray( v ) && i === 0 ){ - each( v, function ( av ) { - - columns.push( (settings.forcePropertyCase === 'lower') - ? av.toLowerCase() - : (settings.forcePropertyCase === 'upper') - ? av.toUpperCase() : av ); - }); - return true; - } - else if ( T.isArray( v ) ){ - nv = {}; - each( v, function ( av, ai ) { - nv[columns[ai]] = av; - }); - v = nv; - - } - else if ( T.isObject( v ) && settings.forcePropertyCase ){ - o = {}; - - eachin( v, function ( av, ai ) { - o[(settings.forcePropertyCase === 'lower') ? ai.toLowerCase() - : (settings.forcePropertyCase === 'upper') - ? ai.toUpperCase() : ai] = v[ai]; - }); - v = o; - } - - RC++; - v.___id = 'T' + String( idpad + TC ).slice( -6 ) + 'R' + - String( idpad + RC ).slice( -6 ); - v.___s = true; - records.push( v.___id ); - if ( settings.template ){ - v = T.mergeObj( settings.template, v ); - } - TOb.push( v ); - - ID[v.___id] = TOb.length - 1; - if ( settings.onInsert && - (runEvent || TAFFY.isUndefined( runEvent )) ) - { - settings.onInsert.call( v ); - } - DBI.dm( new Date() ); - }); - return root( records ); - }, - sort : function ( o ) { - // **************************************** - // * - // * Purpose: Change the sort order of the DB itself and reset the ID bucket - // **************************************** - TOb = orderByCol( TOb, o.split( ',' ) ); - ID = {}; - each( TOb, function ( r, i ) { - ID[r.___id] = i; - }); - DBI.dm( new Date() ); - return true; - }, - update : function ( id, changes, runEvent ) { - // **************************************** - // * - // * Takes: the ID of record being changed and the changes - // * Purpose: Update a record and change some or all values, call the on update method - // **************************************** - - var nc = {}, or, nr, tc, hasChange; - if ( settings.forcePropertyCase ){ - eachin( changes, function ( v, p ) { - nc[(settings.forcePropertyCase === 'lower') ? p.toLowerCase() - : (settings.forcePropertyCase === 'upper') ? p.toUpperCase() - : p] = v; - }); - changes = nc; - } - - or = TOb[ID[id]]; - nr = T.mergeObj( or, changes ); - - tc = {}; - hasChange = false; - eachin( nr, function ( v, i ) { - if ( TAFFY.isUndefined( or[i] ) || or[i] !== v ){ - tc[i] = v; - hasChange = true; - } - }); - if ( hasChange ){ - if ( settings.onUpdate && - (runEvent || TAFFY.isUndefined( runEvent )) ) - { - settings.onUpdate.call( nr, TOb[ID[id]], tc ); - } - TOb[ID[id]] = nr; - DBI.dm( new Date() ); - } - }, - remove : function ( id ) { - // **************************************** - // * - // * Takes: the ID of record to be removed - // * Purpose: remove a record, changes its ___s value to false - // **************************************** - TOb[ID[id]].___s = false; - }, - removeCommit : function ( runEvent ) { - var x; - // **************************************** - // * - // * - // * Purpose: loop over all records and remove records with ___s = false, call onRemove event, clear ID - // **************************************** - for ( x = TOb.length - 1; x > -1; x-- ){ - - if ( !TOb[x].___s ){ - if ( settings.onRemove && - (runEvent || TAFFY.isUndefined( runEvent )) ) - { - settings.onRemove.call( TOb[x] ); - } - ID[TOb[x].___id] = undefined; - TOb.splice( x, 1 ); - } - } - ID = {}; - each( TOb, function ( r, i ) { - ID[r.___id] = i; - }); - DBI.dm( new Date() ); - }, - query : function ( context ) { - // **************************************** - // * - // * Takes: the context object for a query and either returns a cache result or a new query result - // **************************************** - var returnq, cid, results, indexed, limitq, ni; - - if ( settings.cacheSize ) { - cid = ''; - each( context.filterRaw, function ( r ) { - if ( T.isFunction( r ) ){ - cid = 'nocache'; - return TAFFY.EXIT; - } - }); - if ( cid === '' ){ - cid = JSON.stringify( T.mergeObj( context, - {q : false, run : false, sort : false} ) ); - } - } - // Run a new query if there are no results or the run date has been cleared - if ( !context.results || !context.run || - (context.run && DBI.dm() > context.run) ) - { - results = []; - - // check Cache - - if ( settings.cacheSize && Cache[cid] ){ - - Cache[cid].i = CacheCount++; - return Cache[cid].results; - } - else { - // if no filter, return DB - if ( context.q.length === 0 && context.index.length === 0 ){ - each( TOb, function ( r ) { - results.push( r ); - }); - returnq = results; - } - else { - // use indexes - - indexed = runIndexes( context.index ); - - // run filters - each( indexed, function ( r ) { - // Run filter to see if record matches query - if ( context.q.length === 0 || runFilters( r, context.q ) ){ - results.push( r ); - } - }); - - returnq = results; - } - } - - - } - else { - // If query exists and run has not been cleared return the cache results - returnq = context.results; - } - // If a custom order array exists and the run has been clear or the sort has been cleared - if ( context.order.length > 0 && (!context.run || !context.sort) ){ - // order the results - returnq = orderByCol( returnq, context.order ); - } - - // If a limit on the number of results exists and it is less than the returned results, limit results - if ( returnq.length && - ((context.limit && context.limit < returnq.length) || - context.start) - ) { - limitq = []; - each( returnq, function ( r, i ) { - if ( !context.start || - (context.start && (i + 1) >= context.start) ) - { - if ( context.limit ){ - ni = (context.start) ? (i + 1) - context.start : i; - if ( ni < context.limit ){ - limitq.push( r ); - } - else if ( ni > context.limit ){ - return TAFFY.EXIT; - } - } - else { - limitq.push( r ); - } - } - }); - returnq = limitq; - } - - // update cache - if ( settings.cacheSize && cid !== 'nocache' ){ - CacheClear++; - - setTimeout( function () { - var bCounter, nc; - if ( CacheClear >= settings.cacheSize * 2 ){ - CacheClear = 0; - bCounter = CacheCount - settings.cacheSize; - nc = {}; - eachin( function ( r, k ) { - if ( r.i >= bCounter ){ - nc[k] = r; - } - }); - Cache = nc; - } - }, 0 ); - - Cache[cid] = { i : CacheCount++, results : returnq }; - } - return returnq; - } - }; - - - root = function () { - var iAPI, context; - // **************************************** - // * - // * The root function that gets returned when a new DB is created - // * Takes: unlimited filter arguments and creates filters to be run when a query is called - // **************************************** - // **************************************** - // * - // * iAPI is the the method collection valiable when a query has been started by calling dbname - // * Certain methods are or are not avaliable once you have started a query such as insert -- you can only insert into root - // **************************************** - iAPI = TAFFY.mergeObj( TAFFY.mergeObj( API, { insert : undefined } ), - { getDBI : function () { return DBI; }, - getroot : function ( c ) { return root.call( c ); }, - context : function ( n ) { - // **************************************** - // * - // * The context contains all the information to manage a query including filters, limits, and sorts - // **************************************** - if ( n ){ - context = TAFFY.mergeObj( context, - n.hasOwnProperty('results') - ? TAFFY.mergeObj( n, { run : new Date(), sort: new Date() }) - : n - ); - } - return context; - }, - extend : undefined - }); - - context = (this && this.q) ? this : { - limit : false, - start : false, - q : [], - filterRaw : [], - index : [], - order : [], - results : false, - run : null, - sort : null, - settings : settings - }; - // **************************************** - // * - // * Call the query method to setup a new query - // **************************************** - each( arguments, function ( f ) { - - if ( isIndexable( f ) ){ - context.index.push( f ); - } - else { - context.q.push( returnFilter( f ) ); - } - context.filterRaw.push( f ); - }); - - - return iAPI; - }; - - // **************************************** - // * - // * If new records have been passed on creation of the DB either as JSON or as an array/object, insert them - // **************************************** - TC++; - if ( d ){ - DBI.insert( d ); - } - - - root.insert = DBI.insert; - - root.merge = function ( i, key, runEvent ) { - var - search = {}, - finalSearch = [], - obj = {} - ; - - runEvent = runEvent || false; - key = key || 'id'; - - each( i, function ( o ) { - var existingObject; - search[key] = o[key]; - finalSearch.push( o[key] ); - existingObject = root( search ).first(); - if ( existingObject ){ - DBI.update( existingObject.___id, o, runEvent ); - } - else { - DBI.insert( o, runEvent ); - } - }); - - obj[key] = finalSearch; - return root( obj ); - }; - - root.TAFFY = true; - root.sort = DBI.sort; - // **************************************** - // * - // * These are the methods that can be accessed on off the root DB function. Example dbname.insert; - // **************************************** - root.settings = function ( n ) { - // **************************************** - // * - // * Getting and setting for this DB's settings/events - // **************************************** - if ( n ){ - settings = TAFFY.mergeObj( settings, n ); - if ( n.template ){ - - root().update( n.template ); - } - } - return settings; - }; - - // **************************************** - // * - // * These are the methods that can be accessed on off the root DB function. Example dbname.insert; - // **************************************** - root.store = function ( n ) { - // **************************************** - // * - // * Setup localstorage for this DB on a given name - // * Pull data into the DB as needed - // **************************************** - var r = false, i; - if ( localStorage ){ - if ( n ){ - i = localStorage.getItem( 'taffy_' + n ); - if ( i && i.length > 0 ){ - root.insert( i ); - r = true; - } - if ( TOb.length > 0 ){ - setTimeout( function () { - localStorage.setItem( 'taffy_' + settings.storageName, - JSON.stringify( TOb ) ); - }); - } - } - root.settings( {storageName : n} ); - } - return root; - }; - - // **************************************** - // * - // * Return root on DB creation and start having fun - // **************************************** - return root; - }; - // **************************************** - // * - // * Sets the global TAFFY object - // **************************************** - TAFFY = T; - - - // **************************************** - // * - // * Create public each method - // * - // **************************************** - T.each = each; - - // **************************************** - // * - // * Create public eachin method - // * - // **************************************** - T.eachin = eachin; - // **************************************** - // * - // * Create public extend method - // * Add a custom method to the API - // * - // **************************************** - T.extend = API.extend; - - - // **************************************** - // * - // * Creates TAFFY.EXIT value that can be returned to stop an each loop - // * - // **************************************** - TAFFY.EXIT = 'TAFFYEXIT'; - - // **************************************** - // * - // * Create public utility mergeObj method - // * Return a new object where items from obj2 - // * have replaced or been added to the items in - // * obj1 - // * Purpose: Used to combine objs - // * - // **************************************** - TAFFY.mergeObj = function ( ob1, ob2 ) { - var c = {}; - eachin( ob1, function ( v, n ) { c[n] = ob1[n]; }); - eachin( ob2, function ( v, n ) { c[n] = ob2[n]; }); - return c; - }; - - - // **************************************** - // * - // * Create public utility has method - // * Returns true if a complex object, array - // * or taffy collection contains the material - // * provided in the second argument - // * Purpose: Used to comare objects - // * - // **************************************** - TAFFY.has = function ( var1, var2 ) { - - var re = true, n; - - if ( (var1.TAFFY) ){ - re = var1( var2 ); - if ( re.length > 0 ){ - return true; - } - else { - return false; - } - } - else { - - switch ( T.typeOf( var1 ) ){ - case 'object': - if ( T.isObject( var2 ) ){ - eachin( var2, function ( v, n ) { - if ( re === true && !T.isUndefined( var1[n] ) && - var1.hasOwnProperty( n ) ) - { - re = T.has( var1[n], var2[n] ); - } - else { - re = false; - return TAFFY.EXIT; - } - }); - } - else if ( T.isArray( var2 ) ){ - each( var2, function ( v, n ) { - re = T.has( var1, var2[n] ); - if ( re ){ - return TAFFY.EXIT; - } - }); - } - else if ( T.isString( var2 ) ){ - if ( !TAFFY.isUndefined( var1[var2] ) ){ - return true; - } - else { - return false; - } - } - return re; - case 'array': - if ( T.isObject( var2 ) ){ - each( var1, function ( v, i ) { - re = T.has( var1[i], var2 ); - if ( re === true ){ - return TAFFY.EXIT; - } - }); - } - else if ( T.isArray( var2 ) ){ - each( var2, function ( v2, i2 ) { - each( var1, function ( v1, i1 ) { - re = T.has( var1[i1], var2[i2] ); - if ( re === true ){ - return TAFFY.EXIT; - } - }); - if ( re === true ){ - return TAFFY.EXIT; - } - }); - } - else if ( T.isString( var2 ) || T.isNumber( var2 ) ){ - for ( n = 0; n < var1.length; n++ ){ - re = T.has( var1[n], var2 ); - if ( re ){ - return true; - } - } - } - return re; - case 'string': - if ( T.isString( var2 ) && var2 === var1 ){ - return true; - } - break; - default: - if ( T.typeOf( var1 ) === T.typeOf( var2 ) && var1 === var2 ){ - return true; - } - break; - } - } - return false; - }; - - // **************************************** - // * - // * Create public utility hasAll method - // * Returns true if a complex object, array - // * or taffy collection contains the material - // * provided in the call - for arrays it must - // * contain all the material in each array item - // * Purpose: Used to comare objects - // * - // **************************************** - TAFFY.hasAll = function ( var1, var2 ) { - - var T = TAFFY, ar; - if ( T.isArray( var2 ) ){ - ar = true; - each( var2, function ( v ) { - ar = T.has( var1, v ); - if ( ar === false ){ - return TAFFY.EXIT; - } - }); - return ar; - } - else { - return T.has( var1, var2 ); - } - }; - - - // **************************************** - // * - // * typeOf Fixed in JavaScript as public utility - // * - // **************************************** - TAFFY.typeOf = function ( v ) { - var s = typeof v; - if ( s === 'object' ){ - if ( v ){ - if ( typeof v.length === 'number' && - !(v.propertyIsEnumerable( 'length' )) ) - { - s = 'array'; - } - } - else { - s = 'null'; - } - } - return s; - }; - - // **************************************** - // * - // * Create public utility getObjectKeys method - // * Returns an array of an objects keys - // * Purpose: Used to get the keys for an object - // * - // **************************************** - TAFFY.getObjectKeys = function ( ob ) { - var kA = []; - eachin( ob, function ( n, h ) { - kA.push( h ); - }); - kA.sort(); - return kA; - }; - - // **************************************** - // * - // * Create public utility isSameArray - // * Returns an array of an objects keys - // * Purpose: Used to get the keys for an object - // * - // **************************************** - TAFFY.isSameArray = function ( ar1, ar2 ) { - return (TAFFY.isArray( ar1 ) && TAFFY.isArray( ar2 ) && - ar1.join( ',' ) === ar2.join( ',' )) ? true : false; - }; - - // **************************************** - // * - // * Create public utility isSameObject method - // * Returns true if objects contain the same - // * material or false if they do not - // * Purpose: Used to comare objects - // * - // **************************************** - TAFFY.isSameObject = function ( ob1, ob2 ) { - var T = TAFFY, rv = true; - - if ( T.isObject( ob1 ) && T.isObject( ob2 ) ){ - if ( T.isSameArray( T.getObjectKeys( ob1 ), - T.getObjectKeys( ob2 ) ) ) - { - eachin( ob1, function ( v, n ) { - if ( ! ( (T.isObject( ob1[n] ) && T.isObject( ob2[n] ) && - T.isSameObject( ob1[n], ob2[n] )) || - (T.isArray( ob1[n] ) && T.isArray( ob2[n] ) && - T.isSameArray( ob1[n], ob2[n] )) || (ob1[n] === ob2[n]) ) - ) { - rv = false; - return TAFFY.EXIT; - } - }); - } - else { - rv = false; - } - } - else { - rv = false; - } - return rv; - }; - - // **************************************** - // * - // * Create public utility is[DataType] methods - // * Return true if obj is datatype, false otherwise - // * Purpose: Used to determine if arguments are of certain data type - // * - // * mmikowski 2012-08-06 refactored to make much less "magical": - // * fewer closures and passes jslint - // * - // **************************************** - - typeList = [ - 'String', 'Number', 'Object', 'Array', - 'Boolean', 'Null', 'Function', 'Undefined' - ]; - - makeTest = function ( thisKey ) { - return function ( data ) { - return TAFFY.typeOf( data ) === thisKey.toLowerCase() ? true : false; - }; - }; - - for ( idx = 0; idx < typeList.length; idx++ ){ - typeKey = typeList[idx]; - TAFFY['is' + typeKey] = makeTest( typeKey ); - } - } -}()); - -if ( typeof(exports) === 'object' ){ - exports.taffy = TAFFY; -} - diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/.npmignore b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/.npmignore deleted file mode 100644 index 93f1361..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -npm-debug.log diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/lib/wrench.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/lib/wrench.js deleted file mode 100644 index 00f4166..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/lib/wrench.js +++ /dev/null @@ -1,399 +0,0 @@ -/* wrench.js - * - * A collection of various utility functions I've found myself in need of - * for use with Node.js (http://nodejs.org/). This includes things like: - * - * - Recursively deleting directories in Node.js (Sync, not Async) - * - Recursively copying directories in Node.js (Sync, not Async) - * - Recursively chmoding a directory structure from Node.js (Sync, not Async) - * - Other things that I'll add here as time goes on. Shhhh... - * - * ~ Ryan McGrath (ryan [at] venodesigns.net) - */ - -var fs = require("fs"), - _path = require("path"); - - -/* wrench.readdirSyncRecursive("directory_path"); - * - * Recursively dives through directories and read the contents of all the - * children directories. - */ -exports.readdirSyncRecursive = function(baseDir) { - baseDir = baseDir.replace(/\/$/, ''); - - var readdirSyncRecursive = function(baseDir) { - var files = [], - curFiles, - nextDirs, - isDir = function(fname){ - return fs.statSync( _path.join(baseDir, fname) ).isDirectory(); - }, - prependBaseDir = function(fname){ - return _path.join(baseDir, fname); - }; - - curFiles = fs.readdirSync(baseDir); - nextDirs = curFiles.filter(isDir); - curFiles = curFiles.map(prependBaseDir); - - files = files.concat( curFiles ); - - while (nextDirs.length) { - files = files.concat( readdirSyncRecursive( _path.join(baseDir, nextDirs.shift()) ) ); - } - - return files; - }; - - // convert absolute paths to relative - var fileList = readdirSyncRecursive(baseDir).map(function(val){ - return _path.relative(baseDir, val); - }); - - return fileList; -}; - -/* wrench.readdirRecursive("directory_path", function(error, files) {}); - * - * Recursively dives through directories and read the contents of all the - * children directories. - * - * Asynchronous, so returns results/error in callback. - * Callback receives the of files in currently recursed directory. - * When no more directories are left, callback is called with null for all arguments. - * - */ -exports.readdirRecursive = function(baseDir, fn) { - baseDir = baseDir.replace(/\/$/, ''); - - var waitCount = 0; - - function readdirRecursive(curDir) { - var files = [], - curFiles, - nextDirs, - prependcurDir = function(fname){ - return _path.join(curDir, fname); - }; - - waitCount++; - fs.readdir(curDir, function(e, curFiles) { - waitCount--; - - curFiles = curFiles.map(prependcurDir); - - curFiles.forEach(function(it) { - waitCount++; - - fs.stat(it, function(e, stat) { - waitCount--; - - if (e) { - fn(e); - } else { - if (stat.isDirectory()) { - readdirRecursive(it); - } - } - - if (waitCount == 0) { - fn(null, null); - } - }); - }); - - fn(null, curFiles.map(function(val) { - // convert absolute paths to relative - return _path.relative(baseDir, val); - })); - - if (waitCount == 0) { - fn(null, null); - } - }); - }; - - readdirRecursive(baseDir); -}; - - - -/* wrench.rmdirSyncRecursive("directory_path", forceDelete, 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 - * Asynchronous version. :\ - */ -exports.rmdirSyncRecursive = function(path, failSilent) { - var files; - - 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]); - - if(currFile.isDirectory()) // Recursive function back to the beginning - exports.rmdirSyncRecursive(path + "/" + files[i]); - - else if(currFile.isSymbolicLink()) // Unlink symlinks - fs.unlinkSync(path + "/" + files[i]); - - else // Assume it's a file - perhaps a try/catch belongs here? - fs.unlinkSync(path + "/" + files[i]); - } - - /* Now that we know everything in the sub-tree has been deleted, we can delete the main - directory. Huzzah for the shopkeep. */ - return fs.rmdirSync(path); -}; - -/* 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. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { - - if (!opts || !opts.preserve) { - try { - if(fs.statSync(newDirLocation).isDirectory()) exports.rmdirSyncRecursive(newDirLocation); - } 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); - try { - fs.mkdirSync(newDirLocation, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') throw e; - } - - var files = fs.readdirSync(sourceDir); - - for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); - - if(currFile.isDirectory()) { - /* recursion this thing right on back. */ - exports.copyDirSyncRecursive(sourceDir + "/" + files[i], newDirLocation + "/" + files[i], opts); - } else if(currFile.isSymbolicLink()) { - var symlinkFull = fs.readlinkSync(sourceDir + "/" + files[i]); - fs.symlinkSync(symlinkFull, 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); - } - } -}; - -/* wrench.chmodSyncRecursive("directory", filemode); - * - * Recursively dives through a directory and chmods everything to the desired mode. This is a - * Synchronous function, which blocks things until it's done. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -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]); - - if(currFile.isDirectory()) { - /* ...and recursion this thing right on back. */ - exports.chmodSyncRecursive(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); - } - } - - /* Finally, chmod the parent directory */ - fs.chmod(sourceDir, filemode); -}; - - -/* wrench.chownSyncRecursive("directory", uid, gid); - * - * Recursively dives through a directory and chowns everything to the desired user and group. This is a - * Synchronous function, which blocks things until it's done. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -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]); - - if(currFile.isDirectory()) { - /* ...and recursion this thing right on back. */ - exports.chownSyncRecursive(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); - } - } - - /* Finally, chown the parent directory */ - fs.chownSync(sourceDir, uid, gid); -}; - - - -/* wrench.rmdirRecursive("directory_path", callback); - * - * 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); - (function rmFile(err){ - if (err) return clbk(err); - - var filename = files.shift(); - if (filename === null || typeof filename == 'undefined') - return fs.rmdir(dir, clbk); - - var file = dir+'/'+filename; - fs.stat(file, function(err, stat){ - if (err) return clbk(err); - if (stat.isDirectory()) - rmdirRecursive(file, rmFile); - else - fs.unlink(file, rmFile); - }); - })(); - }); -}; - -/* wrench.copyDirRecursive("directory_to_copy", "new_location", callback); - * - * Recursively dives through a directory and moves all its files to a new - * location. - * - * 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); - }); - - fs.stat(srcDir, function(err, srcDirStat){ - if (err) return clbk(err); - fs.mkdir(newDir, srcDirStat.mode, function(err){ - if (err) return clbk(err); - fs.readdir(srcDir, function(err, files){ - if (err) return clbk(err); - (function copyFiles(err){ - if (err) return clbk(err); - - var filename = files.shift(); - if (filename === null || typeof filename == 'undefined') - return clbk(); - - var file = srcDir+'/'+filename, - newFile = newDir+'/'+filename; - - fs.stat(file, function(err, fileStat){ - if (fileStat.isDirectory()) - copyDirRecursive(file, newFile, copyFiles); - else if (fileStat.isSymbolicLink()) - fs.readlink(file, function(err, link){ - fs.symlink(link, newFile, copyFiles); - }); - else - fs.readFile(file, function(err, data){ - fs.writeFile(newFile, data, copyFiles); - }); - }); - })(); - }); - }); - }); - }); -}; - -var mkdirSyncRecursive = function(path, mode) { - var self = this; - - try { - fs.mkdirSync(path, mode); - } catch(err) { - if(err.code == "ENOENT") { - var slashIdx = path.lastIndexOf("/"); - if(slashIdx < 0) { - slashIdx = path.lastIndexOf("\\"); - } - - if(slashIdx > 0) { - var parentPath = path.substring(0, slashIdx); - mkdirSyncRecursive(parentPath, mode); - mkdirSyncRecursive(path, mode); - } else { - throw err; - } - } else if(err.code == "EEXIST") { - return; - } else { - throw err; - } - } -}; -exports.mkdirSyncRecursive = mkdirSyncRecursive; - -exports.LineReader = function(filename, bufferSize) { - this.bufferSize = bufferSize || 8192; - this.buffer = ""; - this.fd = fs.openSync(filename, "r"); - this.currentPosition = 0; -}; - -exports.LineReader.prototype = { - getBufferAndSetCurrentPosition: function(position) { - var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); - - this.buffer += res[0]; - if(res[1] === 0) { - this.currentPosition = -1; - } else { - this.currentPosition = position + res[1]; - } - - return this.currentPosition; - }, - - hasNextLine: function() { - while(this.buffer.indexOf('\n') === -1) { - this.getBufferAndSetCurrentPosition(this.currentPosition); - if(this.currentPosition === -1) return false; - } - - if(this.buffer.indexOf("\n") > -1) return true; - return false; - }, - - getNextLine: function() { - var lineEnd = this.buffer.indexOf("\n"), - result = this.buffer.substring(0, lineEnd); - - this.buffer = this.buffer.substring(result.length + 1, this.buffer.length); - return result; - } -}; - -// vim: et ts=4 sw=4 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/lib/x.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/lib/x.js deleted file mode 100644 index 3ddffd6..0000000 --- a/node_modules/grunt-jsdoc/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/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/package.json b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/package.json deleted file mode 100644 index 9c32abb..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "wrench", - "description": "Recursive filesystem (and other) operations that Node *should* have.", - "version": "1.3.9", - "author": { - "name": "Ryan McGrath", - "email": "ryan@venodesigns.net" - }, - "repository": { - "type": "git", - "url": "git://github.com/ryanmcgrath/wrench-js.git" - }, - "bugs": { - "url": "http://github.com/ryanmcgrath/wrench-js/issues" - }, - "directories": { - "lib": "./lib/" - }, - "dependencies": {}, - "devDependencies": { - "nodeunit": ">= 0.6.4" - }, - "main": "./lib/wrench", - "engines": { - "node": ">=0.1.97" - }, - "scripts": { - "test": "nodeunit tests/runner.js" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" - } - ], - "_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 <1.4.0", - "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/ryanmcgrath/wrench-js" -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/readme.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/readme.md deleted file mode 100644 index 393e3da..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -wrench.js - Recursive file operations in Node.js ----------------------------------------------------------------------------- -While I love Node.js, I've found myself missing some functions. Things like -recursively deleting/chmodding a directory (or even deep copying a directory), -or even a basic line reader, shouldn't need to be re-invented time and time again. - -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: - -Installation ------------------------------------------------------------------------------ - - npm install wrench - -Usage ------------------------------------------------------------------------------ -``` javascript -var wrench = require('wrench'), - util = require('util'); -``` - -### Synchronous operations -``` javascript -// Recursively create directories, sub-trees and all. -wrench.mkdirSyncRecursive(dir, 0777); - -// Recursively delete the entire sub-tree of a directory, then kill the directory -wrench.rmdirSyncRecursive('my_directory_name', failSilently); - -// Recursively read directories contents. -wrench.readdirSyncRecursive('my_directory_name'); - -// Recursively chmod the entire sub-tree of a directory -wrench.chmodSyncRecursive('my_directory_name', 0755); - -// Recursively chown the entire sub-tree of a directory -wrench.chownSyncRecursive("directory", uid, gid); - -// Deep-copy an existing directory -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up'); - -// 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()); -} -``` - -### Asynchronous operations -``` javascript -// Recursively read directories contents -var files = []; -wrench.readdirRecursive('my_directory_name', function(error, curFiles) { - // curFiles is what you want -}); - -``` - -Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath) diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js deleted file mode 100644 index e728516..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js +++ /dev/null @@ -1,26 +0,0 @@ -var testCase = require('nodeunit').testCase; -var fs = require('fs'); -var wrench = require('../lib/wrench'); -var path = require('path'); - -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?'); - - wrench.mkdirSyncRecursive(dir, 0777); - - test.equals(path.existsSync(dir), true, 'Dir should exist now'); - - // clean up - while (dir != __dirname) { - fs.rmdirSync(dir); - dir = path.dirname(dir); - } - - test.done(); - }, -}); - -// vim: et ts=4 sw=4 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir.js deleted file mode 100644 index c314229..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir.js +++ /dev/null @@ -1,52 +0,0 @@ -var testCase = require('nodeunit').testCase; -var fs = require('fs'); -var wrench = require('../lib/wrench'); -var path = require('path'); - - -function checkResult(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); - - test.done(); -} - -module.exports = testCase({ - test_readdirSyncRecursive: function(test) { - var dir = path.join(__dirname, 'readdir'); - - test.ok(path.existsSync(dir), 'Folders should exist'); - - var files = wrench.readdirSyncRecursive(dir); - - checkResult(test, files); - }, - - test_readdirRecursive: function(test) { - var dir = path.join(__dirname, 'readdir'); - - test.ok(path.existsSync(dir), 'Folders should exist'); - - var allFiles = []; - - wrench.readdirRecursive(dir, function(e, files) { - if (e) throw e; - - if (files) { - allFiles = allFiles.concat(files); - } else { - checkResult(test, allFiles); - } - }); - } -}); - -// vim: et ts=4 sw=4 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/bar.txt b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/bar.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/foo/bar/ipsum.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/foo/bar/ipsum.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/foo/dolor.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/foo/dolor.md deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/foo/lorem.txt b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/readdir/foo/lorem.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/runner.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/runner.js deleted file mode 100644 index a5cc8f7..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/tests/runner.js +++ /dev/null @@ -1,7 +0,0 @@ -// `nodeunit tests/runner` -// will run all the tests - -module.exports = { - group_mkdir: require('./mkdir'), - group_readdir: require('./readdir') -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/package.json b/node_modules/grunt-jsdoc/node_modules/jsdoc/package.json deleted file mode 100644 index 4947be3..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "jsdoc", - "version": "3.3.0-alpha9", - "revision": "1403969163513", - "description": "An API documentation generator for JavaScript.", - "keywords": [ - "documentation", - "javascript" - ], - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/jsdoc3/jsdoc" - }, - "dependencies": { - "async": "~0.1.22", - "catharsis": "~0.8.2", - "esprima": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", - "js2xmlparser": "~0.1.0", - "marked": "~0.3.1", - "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" - }, - "devDependencies": { - "gulp": "~3.6.2", - "gulp-eslint": "~0.1.6", - "gulp-json-editor": "~2.0.2", - "istanbul": "~0.2.1", - "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" - }, - "engines": { - "node": ">=0.10" - }, - "scripts": { - "test": "gulp test" - }, - "bin": { - "jsdoc": "./jsdoc.js" - }, - "bugs": { - "url": "https://github.com/jsdoc3/jsdoc/issues" - }, - "author": { - "name": "Michael Mathews", - "email": "micmath@gmail.com" - }, - "contributors": [ - { - "url": "https://github.com/jsdoc3/jsdoc/graphs/contributors" - } - ], - "maintainers": [ - { - "name": "kzh", - "email": "kaleb@hornsby.ws" - }, - { - "name": "hegemonic", - "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 <3.4.0", - "_npmVersion": "1.4.16", - "_npmUser": { - "name": "hegemonic", - "email": "jeffrey.l.williams@gmail.com" - }, - "dist": { - "shasum": "8527b69bfcf5eaf2a6ae82ac01686151bba31660", - "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/commentConvert.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/commentConvert.js deleted file mode 100644 index cac6d87..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/commentConvert.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - @overview Demonstrate how to modify the source code before the parser sees it. - @module plugins/commentConvert - @author Michael Mathews - */ -'use strict'; - -exports.handlers = { - /// - /// Convert ///-style comments into jsdoc comments. - /// @param e - /// @param e.filename - /// @param e.source - /// - beforeParse: function(e) { - e.source = e.source.replace(/(\n[ \t]*\/\/\/[^\n]*)+/g, function($) { - var replacement = '\n/**' + $.replace(/^[ \t]*\/\/\//mg, '').replace(/(\n$|$)/, '*/$1'); - return replacement; - }); - } -}; \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/commentsOnly.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/commentsOnly.js deleted file mode 100644 index a35e96f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/commentsOnly.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @overview Remove everything in a file except JSDoc-style comments. By enabling this plugin, you - * can document source files that are not valid JavaScript (including source files for other - * languages). - * @module plugins/commentsOnly - * @author Jeff Williams - */ -'use strict'; - -exports.handlers = { - beforeParse: function(e) { - // a JSDoc comment looks like: /**[one or more chars]*/ - var comments = e.source.match(/\/\*\*[\s\S]+?\*\//g); - if (comments) { - e.source = comments.join('\n\n'); - } - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/escapeHtml.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/escapeHtml.js deleted file mode 100644 index d587405..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/escapeHtml.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - @overview Escape HTML tags in descriptions. - @module plugins/escapeHtml - @author Michael Mathews - */ -'use strict'; - -exports.handlers = { - /** - Translate HTML tags in descriptions into safe entities. - Replaces <, & and newlines - */ - newDoclet: function(e) { - if (e.doclet.description) { - e.doclet.description = e.doclet.description - .replace(/&/g,'&') - .replace(/'); - } - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/eventDumper.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/eventDumper.js deleted file mode 100644 index 38ca843..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/eventDumper.js +++ /dev/null @@ -1,115 +0,0 @@ -/*global env: true */ -/** - * @overview Dump information about parser events to the console. - * @module plugins/eventDumper - * @author Jeff Williams - */ -'use strict'; - -var _ = require('underscore'); -var util = require('util'); - -var conf = env.conf.eventDumper || {}; -var isRhino = require('jsdoc/util/runtime').isRhino(); - -// Dump the included parser events (defaults to all events) -var events = conf.include || [ - 'parseBegin', - 'fileBegin', - 'beforeParse', - 'jsdocCommentFound', - 'symbolFound', - 'newDoclet', - 'fileComplete', - 'parseComplete', - 'processingComplete' -]; -// Don't dump the excluded parser events -if (conf.exclude) { - events = _.difference(events, conf.exclude); -} - -/** - * Check whether a variable appears to be a Java native object. - * - * @param {*} o - The variable to check. - * @return {boolean} Set to `true` for Java native objects and `false` in all other cases. - */ -function isJavaNativeObject(o) { - if (!isRhino) { - return false; - } - - return o && typeof o === 'object' && typeof o.getClass === 'function'; -} - -/** - * Replace AST node objects in events with a placeholder. - * - * @param {Object} o - An object whose properties may contain AST node objects. - * @return {Object} The modified object. - */ -function replaceNodeObjects(o) { - var doop = require('jsdoc/util/doop'); - - var OBJECT_PLACEHOLDER = ''; - - if (o.code && o.code.node) { - // don't break the original object! - o.code = doop(o.code); - o.code.node = OBJECT_PLACEHOLDER; - } - - if (o.doclet && o.doclet.meta && o.doclet.meta.code && o.doclet.meta.code.node) { - // don't break the original object! - o.doclet.meta.code = doop(o.doclet.meta.code); - o.doclet.meta.code.node = OBJECT_PLACEHOLDER; - } - - if (o.astnode) { - o.astnode = OBJECT_PLACEHOLDER; - } - - return o; -} - -/** - * Get rid of unwanted crud in an event object. - * - * @param {object} e The event object. - * @return {object} The fixed-up object. - */ -function cleanse(e) { - var result = {}; - - Object.keys(e).forEach(function(prop) { - // by default, don't stringify properties that contain an array of functions - if (!conf.includeFunctions && util.isArray(e[prop]) && e[prop][0] && - String(typeof e[prop][0]) === 'function') { - result[prop] = 'function[' + e[prop].length + ']'; - } - // never include functions that belong to the object - else if (typeof e[prop] !== 'function') { - // don't call JSON.stringify() on Java native objects--Rhino will throw an exception - result[prop] = isJavaNativeObject(e[prop]) ? String(e[prop]) : e[prop]; - } - }); - - // allow users to omit node objects, which can be enormous - if (conf.omitNodes) { - result = replaceNodeObjects(result); - } - - return result; -} - -exports.handlers = {}; - -events.forEach(function(eventType) { - exports.handlers[eventType] = function(e) { - console.log( JSON.stringify({ - type: eventType, - content: cleanse(e) - }, null, 4) ); - }; -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/markdown.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/markdown.js deleted file mode 100644 index 7c7df69..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/markdown.js +++ /dev/null @@ -1,82 +0,0 @@ -/*global env: true */ -/** - * @overview Translate doclet descriptions from MarkDown into HTML. - * @module plugins/markdown - * @author Michael Mathews - * @author Ben Blank - */ -'use strict'; - -var conf = env.conf.markdown; -var defaultTags = [ 'classdesc', 'description', '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; - - 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; - } - - return shouldProcess; -} - -/** - * Process the markdown source in a doclet. The properties that should be - * processed are configurable, but always include "classdesc", "description", - * "params", "properties", and "returns". Handled properties can be bare - * strings, objects, or arrays of objects. - */ -function process(doclet) { - tags.forEach(function(tag) { - if ( !hasOwnProp.call(doclet, tag) ) { - return; - } - - if (typeof doclet[tag] === 'string' && shouldProcessString(tag, doclet[tag]) ) { - doclet[tag] = parse(doclet[tag]); - } - else if ( Array.isArray(doclet[tag]) ) { - doclet[tag].forEach(function(value, index, original) { - var inner = {}; - inner[tag] = value; - process(inner); - original[index] = inner[tag]; - }); - } - else if (doclet[tag]) { - process(doclet[tag]); - } - }); -} - -// set up the list of "tags" (properties) to process -if (conf && conf.tags) { - tags = conf.tags.slice(); -} -// set up the list of default tags to exclude from processing -if (conf && conf.excludeTags) { - excludeTags = conf.excludeTags.slice(); -} -defaultTags.forEach(function(tag) { - if (excludeTags.indexOf(tag) === -1 && tags.indexOf(tag) === -1) { - tags.push(tag); - } -}); - -exports.handlers = { - /** - * Translate markdown syntax in a new doclet's description into HTML. Is run - * by JSDoc 3 whenever a "newDoclet" event fires. - */ - newDoclet: function(e) { - process(e.doclet); - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/overloadHelper.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/overloadHelper.js deleted file mode 100644 index 29c384d..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/overloadHelper.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * The Overload Helper plugin automatically adds a signature-like string to the longnames of - * overloaded functions and methods. In JSDoc, this string is known as a _variation_. (The longnames - * of overloaded constructor functions are _not_ updated, so that JSDoc can identify the class' - * members correctly.) - * - * Using this plugin allows you to link to overloaded functions without manually adding `@variation` - * tags to your documentation. - * - * For example, suppose your code includes a function named `foo` that you can call in the - * following ways: - * - * + `foo()` - * + `foo(bar)` - * + `foo(bar, baz)` (where `baz` is repeatable) - * - * This plugin assigns the following variations and longnames to each version of `foo`: - * - * + `foo()` gets the variation `()` and the longname `foo()`. - * + `foo(bar)` gets the variation `(bar)` and the longname `foo(bar)`. - * + `foo(bar, baz)` (where `baz` is repeatable) gets the variation `(bar, ...baz)` and the longname - * `foo(bar, ...baz)`. - * - * You can then link to these functions with `{@link foo()}`, `{@link foo(bar)}`, and - * `{@link foo(bar, ...baz)`. Note that the variation is based on the names of the function - * parameters, _not_ their types. - * - * If you prefer to manually assign variations to certain functions, you can still do so with the - * `@variation` tag. This plugin will not change these variations or add more variations for that - * function, as long as the variations you've defined result in unique longnames. - * - * If an overloaded function includes multiple signatures with the same parameter names, the plugin - * will assign numeric variations instead, starting at `(1)` and counting upwards. - * - * @module plugins/overloadHelper - * @author Jeff Williams - * @license Apache License 2.0 - */ -'use strict'; - -// lookup table of function doclets by longname -var functionDoclets; - -function hasUniqueValues(obj) { - var isUnique = true; - var seen = []; - Object.keys(obj).forEach(function(key) { - if (seen.indexOf(obj[key]) !== -1) { - isUnique = false; - } - - seen.push(obj[key]); - }); - - return isUnique; -} - -function getParamNames(params) { - var names = []; - - params.forEach(function(param) { - var name = param.name || ''; - if (param.variable) { - name = '...' + name; - } - if (name !== '') { - names.push(name); - } - }); - - return names.length ? names.join(', ') : ''; -} - -function getParamVariation(doclet) { - return getParamNames(doclet.params || []); -} - -function getUniqueVariations(doclets) { - var counter = 0; - var variations = {}; - var docletKeys = Object.keys(doclets); - - function getUniqueNumbers() { - var format = require('util').format; - - docletKeys.forEach(function(doclet) { - var newLongname; - - while (true) { - counter++; - variations[doclet] = String(counter); - - // is this longname + variation unique? - newLongname = format('%s(%s)', doclets[doclet].longname, variations[doclet]); - if ( !functionDoclets[newLongname] ) { - break; - } - } - }); - } - - function getUniqueNames() { - // start by trying to preserve existing variations - docletKeys.forEach(function(doclet) { - variations[doclet] = doclets[doclet].variation || getParamVariation(doclets[doclet]); - }); - - // if they're identical, try again, without preserving existing variations - if ( !hasUniqueValues(variations) ) { - docletKeys.forEach(function(doclet) { - variations[doclet] = getParamVariation(doclets[doclet]); - }); - - // if they're STILL identical, switch to numeric variations - if ( !hasUniqueValues(variations) ) { - getUniqueNumbers(); - } - } - } - - // are we already using numeric variations? if so, keep doing that - if (functionDoclets[doclets.newDoclet.longname + '(1)']) { - getUniqueNumbers(); - } - else { - getUniqueNames(); - } - - return variations; -} - -function ensureUniqueLongname(newDoclet) { - var doclets = { - oldDoclet: functionDoclets[newDoclet.longname], - newDoclet: newDoclet - }; - var docletKeys = Object.keys(doclets); - var oldDocletLongname; - var variations = {}; - - if (doclets.oldDoclet) { - oldDocletLongname = doclets.oldDoclet.longname; - // if the shared longname has a variation, like MyClass#myLongname(variation), - // remove the variation - if (doclets.oldDoclet.variation || doclets.oldDoclet.variation === '') { - docletKeys.forEach(function(doclet) { - doclets[doclet].longname = doclets[doclet].longname.replace(/\([\s\S]*\)$/, ''); - doclets[doclet].variation = null; - }); - } - - variations = getUniqueVariations(doclets); - - // update the longnames/variations - docletKeys.forEach(function(doclet) { - doclets[doclet].longname += '(' + variations[doclet] + ')'; - doclets[doclet].variation = variations[doclet]; - }); - - // update the old doclet in the lookup table - functionDoclets[oldDocletLongname] = null; - functionDoclets[doclets.oldDoclet.longname] = doclets.oldDoclet; - } - - // always store the new doclet in the lookup table - functionDoclets[doclets.newDoclet.longname] = doclets.newDoclet; - - return doclets.newDoclet; -} - -exports.handlers = { - parseBegin: function() { - functionDoclets = {}; - }, - - newDoclet: function(e) { - if (e.doclet.kind === 'function') { - e.doclet = ensureUniqueLongname(e.doclet); - } - }, - - parseComplete: function() { - functionDoclets = null; - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/partial.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/partial.js deleted file mode 100644 index 2718adc..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/partial.js +++ /dev/null @@ -1,32 +0,0 @@ -/*global env: true */ -/** - @overview Adds support for reusable partial jsdoc files. - @module plugins/partial - @author Ludo Antonov - */ -'use strict'; - -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" - /// - 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 partialData = fs.readFileSync(fullPath, env.opts.encoding); - - return partialData; - }); - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/railsTemplate.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/railsTemplate.js deleted file mode 100644 index 6a408f6..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/railsTemplate.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - @overview Strips the rails template tags from a js.erb file - @module plugins/railsTemplate - @author Jannon Frank - */ -'use strict'; - -exports.handlers = { - /** - * Remove rails tags from the source input (e.g. <% foo bar %>) - * @param e - * @param e.filename - * @param e.source - */ - beforeParse: function(e) { - if (e.filename.match(/\.erb$/)) { - e.source = e.source.replace(/<%.*%>/g, ''); - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/shout.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/shout.js deleted file mode 100644 index 34ed07c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/shout.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - @overview This is just an example. - @module plugins/shout - @author Michael Mathews - */ -'use strict'; - -exports.handlers = { - /** - Make your descriptions more shoutier. - */ - newDoclet: function(e) { - if (typeof e.doclet.description === 'string') { - e.doclet.description = e.doclet.description.toUpperCase(); - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/sourcetag.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/sourcetag.js deleted file mode 100644 index 2385426..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/sourcetag.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - @module plugins/sourcetag - @author Michael Mathews - */ -'use strict'; - -var logger = require('jsdoc/util/logger'); - -exports.handlers = { - /** - Support @source tag. Expected value like: - { "filename": "myfile.js", "lineno": 123 } - Modifies the corresponding meta values on the given doclet. - - WARNING: If you are using a JSDoc template that generates pretty-printed source files, - such as JSDoc's default template, this plugin can cause JSDoc to crash. To fix this issue, - update your template settings to disable pretty-printed source files. - - @source { "filename": "sourcetag.js", "lineno": 13 } - */ - newDoclet: function(e) { - var tags = e.doclet.tags, - tag, - value; - - //console.log(e.doclet); - // any user-defined tags in this doclet? - if (typeof tags !== 'undefined') { - // only interested in the @source tags - tags = tags.filter(function($) { - return $.title === 'source'; - }); - - if (tags.length) { - // take the first one - tag = tags[0]; - - try { - value = JSON.parse(tag.value); - } - catch(e) { - logger.error('@source tag expects a valid JSON value, like { "filename": "myfile.js", "lineno": 123 }.'); - return; - } - - e.doclet.meta = e.doclet.meta || {}; - e.doclet.meta.filename = value.filename || ''; - e.doclet.meta.lineno = value.lineno || ''; - } - } - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/overloadHelper.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/overloadHelper.js deleted file mode 100644 index 12c298c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/overloadHelper.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * A bowl of non-spicy soup. - * @class - *//** - * A bowl of spicy soup. - * @class - * @param {number} spiciness - The spiciness of the soup, in Scoville heat units (SHU). - */ -function Soup(spiciness) {} - -/** - * Slurp the soup. - *//** - * Slurp the soup loudly. - * @param {number} dBA - The slurping volume, in A-weighted decibels. - */ -Soup.prototype.slurp = function(dBA) {}; - -/** - * Salt the soup as needed, using a highly optimized soup-salting heuristic. - *//** - * Salt the soup, specifying the amount of salt to add. - * @variation mg - * @param {number} amount - The amount of salt to add, in milligrams. - */ -Soup.prototype.salt = function(amount) {}; - -/** - * Heat the soup by the specified number of degrees. - * @param {number} degrees - The number of degrees, in Fahrenheit, by which to heat the soup. - *//** - * Heat the soup by the specified number of degrees. - * @variation 1 - * @param {string} degrees - The number of degrees, in Fahrenheit, by which to heat the soup, but - * as a string for some reason. - *//** - * Heat the soup by the specified number of degrees. - * @param {boolean} degrees - The number of degrees, as a boolean. Wait, what? - */ -Soup.prototype.heat = function(degrees) {}; - -/** - * Discard the soup. - * @variation discardSoup - *//** - * Discard the soup by pouring it into the specified container. - * @variation discardSoup - * @param {Object} container - The container in which to discard the soup. - */ -Soup.prototype.discard = function(container) {}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb deleted file mode 100644 index c3df649..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb +++ /dev/null @@ -1,19 +0,0 @@ -/** - @overview Strips the rails template tags from a js.erb file - @module plugins/railsTemplate - @author Jannon Frank - */ - -exports.handlers = { - /** - * Remove rails tags from the source input (e.g. <% foo bar %>) - * @param e - * @param e.filename - * @param e.source - */ - beforeParse: function(e) { - if (e.filename.match(/\.erb$/)) { - e.source = e.source.replace(/<%.*%> /g, ""); - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js deleted file mode 100644 index 6aba419..0000000 --- a/node_modules/grunt-jsdoc/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/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/commentConvert.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/commentConvert.js deleted file mode 100644 index dc29b80..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/commentConvert.js +++ /dev/null @@ -1,19 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -describe("commentConvert plugin", function() { - var parser = jasmine.createParser(); - var path = require('jsdoc/path'); - - var docSet; - - var pluginPath = 'plugins/commentConvert'; - var pluginPathResolved = path.join(env.dirname, pluginPath); - var plugin = require(pluginPathResolved); - - require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); - docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); - - it("should convert '///-style comments into jsdoc comments", function() { - var doclet = docSet.getByLongname("module:plugins/commentConvert.handlers.beforeParse"); - expect(doclet.length).toEqual(1); - }); -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/escapeHtml.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/escapeHtml.js deleted file mode 100644 index 0698938..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/escapeHtml.js +++ /dev/null @@ -1,19 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -describe("escapeHtml plugin", function() { - var parser = jasmine.createParser(); - var path = require('jsdoc/path'); - - var docSet; - - var pluginPath = 'plugins/escapeHtml'; - var pluginPathResolved = path.join(env.dirname,pluginPath); - var plugin = require(pluginPathResolved); - - require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); - docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); - - it("should escape '&', '<' and newlines in doclet descriptions", function() { - var doclet = docSet.getByLongname("module:plugins/escapeHtml.handlers.newDoclet"); - expect(doclet[0].description).toEqual("Translate HTML tags in descriptions into safe entities.
    Replaces <, & and newlines"); - }); -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/markdown.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/markdown.js deleted file mode 100644 index c9d89cc..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/markdown.js +++ /dev/null @@ -1,29 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ - -var path = require('jsdoc/path'); - -describe("markdown plugin", function() { - //TODO -}); - -describe("markdown see tag support", function() { - var pluginPath = 'plugins/markdown'; - var pluginPathResolved = path.join(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]; - - 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/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/overloadHelper.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/overloadHelper.js deleted file mode 100644 index 0538fa4..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/overloadHelper.js +++ /dev/null @@ -1,101 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true, xit: true */ -describe('plugins/overloadHelper', function() { - var parser = jasmine.createParser(); - var path = require('jsdoc/path'); - - var docSet; - - var pluginPath = 'plugins/overloadHelper'; - var pluginPathResolved = path.resolve(env.dirname, pluginPath); - var plugin = require(pluginPathResolved); - - require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); - docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/overloadHelper.js', parser); - - it('should exist', function() { - expect(plugin).toBeDefined(); - expect(typeof plugin).toBe('object'); - }); - - it('should export handlers', function() { - expect(plugin.handlers).toBeDefined(); - expect(typeof plugin.handlers).toBe('object'); - }); - - it('should export a "newDoclet" handler', function() { - expect(plugin.handlers.newDoclet).toBeDefined(); - expect(typeof plugin.handlers.newDoclet).toBe('function'); - }); - - it('should export a "parseComplete" handler', function() { - expect(plugin.handlers.parseComplete).toBeDefined(); - expect(typeof plugin.handlers.parseComplete).toBe('function'); - }); - - describe('newDoclet handler', function() { - it('should not add unique longnames to constructors', function() { - var soup = docSet.getByLongname('Soup'); - var soup1 = docSet.getByLongname('Soup()'); - var soup2 = docSet.getByLongname('Soup(spiciness)'); - - expect(soup.length).toBe(2); - expect(soup1.length).toBe(0); - expect(soup2.length).toBe(0); - }); - - it('should add unique longnames to methods', function() { - var slurp = docSet.getByLongname('Soup#slurp'); - var slurp1 = docSet.getByLongname('Soup#slurp()'); - var slurp2 = docSet.getByLongname('Soup#slurp(dBA)'); - - expect(slurp.length).toBe(0); - expect(slurp1.length).toBe(1); - expect(slurp2.length).toBe(1); - }); - - it('should update the "variation" property of the method', function() { - var slurp1 = docSet.getByLongname('Soup#slurp()')[0]; - var slurp2 = docSet.getByLongname('Soup#slurp(dBA)')[0]; - - expect(slurp1.variation).toBe(''); - expect(slurp2.variation).toBe('dBA'); - }); - - it('should not add to or change existing variations that are unique', function() { - var salt1 = docSet.getByLongname('Soup#salt'); - var salt2 = docSet.getByLongname('Soup#salt(mg)'); - - expect(salt1.length).toBe(1); - expect(salt2.length).toBe(1); - }); - - it('should not duplicate the names of existing numeric variations', function() { - var heat1 = docSet.getByLongname('Soup#heat(1)'); - var heat2 = docSet.getByLongname('Soup#heat(2)'); - var heat3 = docSet.getByLongname('Soup#heat(3)'); - - expect(heat1.length).toBe(1); - expect(heat2.length).toBe(1); - expect(heat3.length).toBe(1); - }); - - it('should replace identical variations with new, unique variations', function() { - var discard1 = docSet.getByLongname('Soup#discard()'); - var discard2 = docSet.getByLongname('Soup#discard(container)'); - - expect(discard1.length).toBe(1); - expect(discard2.length).toBe(1); - }); - }); - - describe('parseComplete handler', function() { - // disabled because on the second run, each comment is being parsed twice; who knows why... - xit('should not retain parse results between parser runs', function() { - parser.clear(); - docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/overloadHelper.js', parser); - var heat = docSet.getByLongname('Soup#heat(4)'); - - expect(heat.length).toBe(0); - }); - }); -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/railsTemplate.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/railsTemplate.js deleted file mode 100644 index feebd74..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/railsTemplate.js +++ /dev/null @@ -1,17 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -describe("railsTemplate plugin", function() { - var parser = jasmine.createParser(); - var path = require('jsdoc/path'); - - var pluginPath = path.join(env.dirname, 'plugins/railsTemplate'); - var plugin = require(pluginPath); - - require('jsdoc/plugins').installPlugins([pluginPath], parser); - require('jsdoc/src/handlers').attachTo(parser); - - it("should remove <% %> rails template tags from the source of *.erb files", function() { - var docSet = parser.parse([path.join(env.dirname, "plugins/test/fixtures/railsTemplate.js.erb")]); - - expect(docSet[2].description).toEqual("Remove rails tags from the source input (e.g. )"); - }); -}); \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/shout.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/shout.js deleted file mode 100644 index 7b59184..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/shout.js +++ /dev/null @@ -1,19 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -describe("shout plugin", function() { - var parser = jasmine.createParser(); - var path = require('jsdoc/path'); - - var docSet; - - var pluginPath = 'plugins/shout'; - var pluginPathResolved = path.join(env.dirname, pluginPath); - var plugin = require(pluginPathResolved); - - require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); - docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); - - it("should make the description uppercase", function() { - var doclet = docSet.getByLongname("module:plugins/shout.handlers.newDoclet"); - expect(doclet[0].description).toEqual("MAKE YOUR DESCRIPTIONS MORE SHOUTIER."); - }); -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/sourcetag.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/sourcetag.js deleted file mode 100644 index ab154bf..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/test/specs/sourcetag.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -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 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"); - expect(doclet[0].meta).toBeDefined(); - expect(doclet[0].meta.filename).toEqual("sourcetag.js"); - expect(doclet[0].meta.lineno).toEqual(13); - }); -}); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/README.md deleted file mode 100644 index 7424e74..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/README.md +++ /dev/null @@ -1,27 +0,0 @@ -To create or use your own template: - -1. Create a folder with the same name as your template (for example, `mycooltemplate`). -2. Within the template folder, create a file named `publish.js`. This file must be a CommonJS module that exports a method named `publish`. - -For example: - -````javascript -/** @module publish */ - -/** - * Generate documentation output. - * - * @param {TAFFY} data - A TaffyDB collection representing - * all the symbols documented in your code. - * @param {object} opts - An object with options information. - */ -exports.publish = function(data, opts) { - // do stuff here to generate your output files -}; -```` - -To invoke JSDoc 3 with your own template, use the `-t` command line option, and specify the path to your template folder: - -```` -./jsdoc mycode.js -t /path/to/mycooltemplate -```` diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/README.md deleted file mode 100644 index a7bd96b..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/README.md +++ /dev/null @@ -1 +0,0 @@ -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). diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/publish.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/publish.js deleted file mode 100644 index c7ac385..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/publish.js +++ /dev/null @@ -1,661 +0,0 @@ -/*global env: true */ -'use strict'; - -var fs = require('jsdoc/fs'); -var helper = require('jsdoc/util/templateHelper'); -var logger = require('jsdoc/util/logger'); -var path = require('jsdoc/path'); -var taffy = require('taffydb').taffy; -var template = require('jsdoc/template'); -var util = require('util'); - -var htmlsafe = helper.htmlsafe; -var linkto = helper.linkto; -var resolveAuthorLinks = helper.resolveAuthorLinks; -var scopeToPunc = helper.scopeToPunc; -var hasOwnProp = Object.prototype.hasOwnProperty; - -var data; -var view; - -var outdir = env.opts.destination; - -function find(spec) { - return helper.find(data, spec); -} - -function tutoriallink(tutorial) { - return helper.toTutorial(tutorial, null, { tag: 'em', classname: 'disabled', prefix: 'Tutorial: ' }); -} - -function getAncestorLinks(doclet) { - return helper.getAncestorLinks(data, doclet); -} - -function hashToLink(doclet, hash) { - if ( !/^(#.+)/.test(hash) ) { return hash; } - - var url = helper.createLink(doclet); - - url = url.replace(/(#.+|$)/, hash); - return '' + hash + ''; -} - -function needsSignature(doclet) { - var needsSig = false; - - // function and class definitions always get a signature - if (doclet.kind === 'function' || doclet.kind === 'class') { - needsSig = true; - } - // typedefs that contain functions get a signature, too - else if (doclet.kind === 'typedef' && doclet.type && doclet.type.names && - doclet.type.names.length) { - for (var i = 0, l = doclet.type.names.length; i < l; i++) { - if (doclet.type.names[i].toLowerCase() === 'function') { - needsSig = true; - break; - } - } - } - - return needsSig; -} - -function getSignatureAttributes(item) { - var attributes = []; - - if (item.optional) { - attributes.push('opt'); - } - - if (item.nullable === true) { - attributes.push('nullable'); - } - else if (item.nullable === false) { - attributes.push('non-null'); - } - - return attributes; -} - -function updateItemName(item) { - var attributes = getSignatureAttributes(item); - var itemName = item.name || ''; - - if (item.variable) { - itemName = '…' + itemName; - } - - if (attributes && attributes.length) { - itemName = util.format( '%s%s', itemName, - attributes.join(', ') ); - } - - return itemName; -} - -function addParamAttributes(params) { - return params.filter(function(param) { - return param.name && param.name.indexOf('.') === -1; - }).map(updateItemName); -} - -function buildItemTypeStrings(item) { - var types = []; - - if (item.type && item.type.names) { - item.type.names.forEach(function(name) { - types.push( linkto(name, htmlsafe(name)) ); - }); - } - - return types; -} - -function buildAttribsString(attribs) { - var attribsString = ''; - - if (attribs && attribs.length) { - attribsString = htmlsafe( util.format('(%s) ', attribs.join(', ')) ); - } - - return attribsString; -} - -function addNonParamAttributes(items) { - var types = []; - - items.forEach(function(item) { - types = types.concat( buildItemTypeStrings(item) ); - }); - - return types; -} - -function addSignatureParams(f) { - var params = f.params ? addParamAttributes(f.params) : []; - - f.signature = util.format( '%s(%s)', (f.signature || ''), params.join(', ') ); -} - -function addSignatureReturns(f) { - var attribs = []; - var attribsString = ''; - var returnTypes = []; - var returnTypesString = ''; - - // jam all the return-type attributes into an array. this could create odd results (for example, - // if there are both nullable and non-nullable return types), but let's assume that most people - // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa. - if (f.returns) { - f.returns.forEach(function(item) { - helper.getAttribs(item).forEach(function(attrib) { - if (attribs.indexOf(attrib) === -1) { - attribs.push(attrib); - } - }); - }); - - attribsString = buildAttribsString(attribs); - } - - if (f.returns) { - returnTypes = addNonParamAttributes(f.returns); - } - if (returnTypes.length) { - returnTypesString = util.format( ' → %s{%s}', attribsString, returnTypes.join('|') ); - } - - f.signature = '' + (f.signature || '') + '' + - '' + returnTypesString + ''; -} - -function addSignatureTypes(f) { - var types = f.type ? buildItemTypeStrings(f) : []; - - f.signature = (f.signature || '') + '' + - (types.length ? ' :' + types.join('|') : '') + ''; -} - -function addAttribs(f) { - var attribs = helper.getAttribs(f); - var attribsString = buildAttribsString(attribs); - - f.attribs = util.format('%s', attribsString); -} - -function shortenPaths(files, commonPrefix) { - Object.keys(files).forEach(function(file) { - files[file].shortened = files[file].resolved.replace(commonPrefix, '') - // always use forward slashes - .replace(/\\/g, '/'); - }); - - return files; -} - -function getPathFromDoclet(doclet) { - if (!doclet.meta) { - return null; - } - - return doclet.meta.path && doclet.meta.path !== 'null' ? - path.join(doclet.meta.path, doclet.meta.filename) : - doclet.meta.filename; -} - -function generate(title, docs, filename, resolveLinks) { - resolveLinks = resolveLinks === false ? false : true; - - var docData = { - title: title, - docs: docs - }; - - var outpath = path.join(outdir, filename), - html = view.render('container.tmpl', docData); - - if (resolveLinks) { - html = helper.resolveLinks(html); // turn {@link foo} into foo - } - - fs.writeFileSync(outpath, html, 'utf8'); -} - -function generateSourceFiles(sourceFiles, encoding) { - encoding = encoding || 'utf8'; - Object.keys(sourceFiles).forEach(function(file) { - var source; - // links are keyed to the shortened path in each doclet's `meta.shortpath` property - var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened); - helper.registerLink(sourceFiles[file].shortened, sourceOutfile); - - try { - source = { - kind: 'source', - code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) ) - }; - } - catch(e) { - logger.error('Error while generating source file %s: %s', file, e.message); - } - - generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile, - false); - }); -} - -/** - * Look for classes or functions with the same name as modules (which indicates that the module - * exports only that class or function), then attach the classes or functions to the `module` - * property of the appropriate module doclets. The name of each class or function is also updated - * for display purposes. This function mutates the original arrays. - * - * @private - * @param {Array.} doclets - The array of classes and functions to - * check. - * @param {Array.} modules - The array of module doclets to search. - */ -function attachModuleSymbols(doclets, modules) { - var symbols = {}; - - // build a lookup table - doclets.forEach(function(symbol) { - symbols[symbol.longname] = symbol; - }); - - return modules.map(function(module) { - if (symbols[module.longname]) { - module.module = symbols[module.longname]; - module.module.name = module.module.name.replace('module:', '(require("') + '"))'; - } - }); -} - -/** - * Create the navigation sidebar. - * @param {object} members The members that will be used to create the sidebar. - * @param {array} members.classes - * @param {array} members.externals - * @param {array} members.globals - * @param {array} members.mixins - * @param {array} members.modules - * @param {array} members.namespaces - * @param {array} members.tutorials - * @param {array} members.events - * @return {string} The HTML for the navigation sidebar. - */ -function buildNav(members) { - var nav = '

    Index

    ', - seen = {}, - hasClassList = false, - classNav = '', - globalNav = ''; - - 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 += '
  • ' + linkto(c.longname, c.name) + '
  • '; - } - 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 += '
    '; - } - - if (members.globals.length) { - members.globals.forEach(function(g) { - if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) { - globalNav += '
  • ' + linkto(g.longname, g.name) + '
  • '; - } - seen[g.longname] = true; - }); - - if (!globalNav) { - // turn the heading into a link so you can actually get to the global page - nav += '

    ' + linkto('global', 'Global') + '

    '; - } - else { - nav += '

    Global

      ' + globalNav + '
    '; - } - } - - return nav; -} - -/** - @param {TAFFY} taffyData See . - @param {object} opts - @param {Tutorial} tutorials - */ -exports.publish = function(taffyData, opts, tutorials) { - data = taffyData; - - var conf = env.conf.templates || {}; - conf['default'] = conf['default'] || {}; - - var templatePath = opts.template; - view = new template.Template(templatePath + '/tmpl'); - - // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness - // doesn't try to hand them out later - var indexUrl = helper.getUniqueFilename('index'); - // don't call registerLink() on this one! 'index' is also a valid longname - - var globalUrl = helper.getUniqueFilename('global'); - helper.registerLink('global', globalUrl); - - // set up templating - view.layout = conf['default'].layoutFile ? - path.getResourcePath(path.dirname(conf['default'].layoutFile), - path.basename(conf['default'].layoutFile) ) : - 'layout.tmpl'; - - // set up tutorials for helper - helper.setTutorials(tutorials); - - data = helper.prune(data); - data.sort('longname, version, since'); - helper.addEventListeners(data); - - var sourceFiles = {}; - var sourceFilePaths = []; - data().each(function(doclet) { - doclet.attribs = ''; - - if (doclet.examples) { - doclet.examples = doclet.examples.map(function(example) { - var caption, code; - - if (example.match(/^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) { - caption = RegExp.$1; - code = RegExp.$3; - } - - return { - caption: caption || '', - code: code || example - }; - }); - } - if (doclet.see) { - doclet.see.forEach(function(seeItem, i) { - doclet.see[i] = hashToLink(doclet, seeItem); - }); - } - - // build a list of source files - var sourcePath; - if (doclet.meta) { - sourcePath = getPathFromDoclet(doclet); - sourceFiles[sourcePath] = { - resolved: sourcePath, - shortened: null - }; - if (sourceFilePaths.indexOf(sourcePath) === -1) { - sourceFilePaths.push(sourcePath); - } - } - }); - - // 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); - } - fs.mkPath(outdir); - - // copy the template's static files to outdir - var fromDir = path.join(templatePath, 'static'); - var staticFiles = fs.ls(fromDir, 3); - - staticFiles.forEach(function(fileName) { - var toDir = fs.toDir( fileName.replace(fromDir, outdir) ); - fs.mkPath(toDir); - fs.copyFileSync(fileName, toDir); - }); - - // copy user-specified static files to outdir - 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); - staticFileScanner = new (require('jsdoc/src/scanner')).Scanner(); - - staticFilePaths.forEach(function(filePath) { - var extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter); - - extraStaticFiles.forEach(function(fileName) { - var sourcePath = fs.toDir(filePath); - var toDir = fs.toDir( fileName.replace(sourcePath, outdir) ); - fs.mkPath(toDir); - fs.copyFileSync(fileName, toDir); - }); - }); - } - - if (sourceFilePaths.length) { - sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) ); - } - data().each(function(doclet) { - var url = helper.createLink(doclet); - helper.registerLink(doclet.longname, url); - - // add a shortened version of the full path - var docletPath; - if (doclet.meta) { - docletPath = getPathFromDoclet(doclet); - docletPath = sourceFiles[docletPath].shortened; - if (docletPath) { - doclet.meta.shortpath = docletPath; - } - } - }); - - data().each(function(doclet) { - var url = helper.longnameToUrl[doclet.longname]; - - if (url.indexOf('#') > -1) { - doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop(); - } - else { - doclet.id = doclet.name; - } - - if ( needsSignature(doclet) ) { - addSignatureParams(doclet); - addSignatureReturns(doclet); - addAttribs(doclet); - } - }); - - // do this after the urls have all been generated - data().each(function(doclet) { - doclet.ancestors = getAncestorLinks(doclet); - - if (doclet.kind === 'member') { - addSignatureTypes(doclet); - addAttribs(doclet); - } - - if (doclet.kind === 'constant') { - addSignatureTypes(doclet); - addAttribs(doclet); - doclet.kind = 'member'; - } - }); - - var members = helper.getMembers(data); - members.tutorials = tutorials.children; - - // output pretty-printed source files by default - var outputSourceFiles = conf['default'] && conf['default'].outputSourceFiles !== false ? true : - false; - - // add template helpers - view.find = find; - view.linkto = linkto; - view.resolveAuthorLinks = resolveAuthorLinks; - view.tutoriallink = tutoriallink; - view.htmlsafe = htmlsafe; - view.outputSourceFiles = outputSourceFiles; - - // once for all - view.nav = buildNav(members); - attachModuleSymbols( find({ kind: ['class', 'function'], longname: {left: 'module:'} }), - members.modules ); - - // generate the pretty-printed source files first so other pages can link to them - if (outputSourceFiles) { - generateSourceFiles(sourceFiles, opts.encoding); - } - - if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); } - - // index page displays information from package.json and lists files - var files = find({kind: 'file'}), - packages = find({kind: 'package'}); - - generate('Index', - packages.concat( - [{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}] - ).concat(files), - indexUrl); - - // set up the lists that we'll use to generate pages - var classes = taffy(members.classes); - var modules = taffy(members.modules); - var namespaces = taffy(members.namespaces); - var mixins = taffy(members.mixins); - var externals = taffy(members.externals); - - 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 myNamespaces = helper.find(namespaces, {longname: longname}); - if (myNamespaces.length) { - generate('Namespace: ' + myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]); - } - - var myMixins = helper.find(mixins, {longname: longname}); - if (myMixins.length) { - generate('Mixin: ' + myMixins[0].name, myMixins, helper.longnameToUrl[longname]); - } - - var myExternals = helper.find(externals, {longname: longname}); - if (myExternals.length) { - generate('External: ' + myExternals[0].name, myExternals, helper.longnameToUrl[longname]); - } - }); - - // TODO: move the tutorial functions to templateHelper.js - function generateTutorial(title, tutorial, filename) { - var tutorialData = { - title: title, - header: tutorial.title, - content: tutorial.parse(), - children: tutorial.children - }; - - var tutorialPath = path.join(outdir, filename), - html = view.render('tutorial.tmpl', tutorialData); - - // yes, you can use {@link} in tutorials too! - html = helper.resolveLinks(html); // turn {@link foo} into foo - - fs.writeFileSync(tutorialPath, html, 'utf8'); - } - - // tutorials can have only one parent so there is no risk for loops - function saveChildren(node) { - node.children.forEach(function(child) { - generateTutorial('Tutorial: ' + child.title, child, helper.tutorialToUrl(child.name)); - saveChildren(child); - }); - } - saveChildren(tutorials); -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/linenumber.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/linenumber.js deleted file mode 100644 index 8d52f7e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/linenumber.js +++ /dev/null @@ -1,25 +0,0 @@ -/*global document */ -(function() { - var source = document.getElementsByClassName('prettyprint source linenums'); - var i = 0; - var lineNumber = 0; - var lineId; - var lines; - var totalLines; - var anchorHash; - - if (source && source[0]) { - anchorHash = document.location.hash.substring(1); - lines = source[0].getElementsByTagName('li'); - totalLines = lines.length; - - for (; i < totalLines; i++) { - lineNumber++; - lineId = 'line' + lineNumber; - lines[i].id = lineId; - if (lineId === anchorHash) { - lines[i].className += ' selected'; - } - } - } -})(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/Apache-License-2.0.txt b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/Apache-License-2.0.txt deleted file mode 100644 index d645695..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/Apache-License-2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/lang-css.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/lang-css.js deleted file mode 100644 index 041e1f5..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/lang-css.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/prettify.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/prettify.js deleted file mode 100644 index eef5ad7..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/scripts/prettify/prettify.js +++ /dev/null @@ -1,28 +0,0 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p p:first-child -{ - margin-top: 0; - padding-top: 0; -} - -.params td.description > p:last-child -{ - margin-bottom: 0; - padding-bottom: 0; -} - -.disabled { - color: #454545; -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/styles/prettify-jsdoc.css b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/styles/prettify-jsdoc.css deleted file mode 100644 index 5a2526e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/styles/prettify-jsdoc.css +++ /dev/null @@ -1,111 +0,0 @@ -/* JSDoc prettify.js theme */ - -/* plain text */ -.pln { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* string content */ -.str { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a keyword */ -.kwd { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a comment */ -.com { - font-weight: normal; - font-style: italic; -} - -/* a type name */ -.typ { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* a literal value */ -.lit { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* punctuation */ -.pun { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* lisp open bracket */ -.opn { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* lisp close bracket */ -.clo { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a markup tag name */ -.tag { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a markup attribute name */ -.atn { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a markup attribute value */ -.atv { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a declaration */ -.dec { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a variable name */ -.var { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* a function name */ -.fun { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin-top: 0; - margin-bottom: 0; -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css deleted file mode 100644 index aa2908c..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css +++ /dev/null @@ -1,132 +0,0 @@ -/* Tomorrow Theme */ -/* Original theme - https://github.com/chriskempson/tomorrow-theme */ -/* Pretty printing styles. Used with prettify.js. */ -/* SPAN elements with the classes below are added by prettyprint. */ -/* plain text */ -.pln { - color: #4d4d4c; } - -@media screen { - /* string content */ - .str { - color: #718c00; } - - /* a keyword */ - .kwd { - color: #8959a8; } - - /* a comment */ - .com { - color: #8e908c; } - - /* a type name */ - .typ { - color: #4271ae; } - - /* a literal value */ - .lit { - color: #f5871f; } - - /* punctuation */ - .pun { - color: #4d4d4c; } - - /* lisp open bracket */ - .opn { - color: #4d4d4c; } - - /* lisp close bracket */ - .clo { - color: #4d4d4c; } - - /* a markup tag name */ - .tag { - color: #c82829; } - - /* a markup attribute name */ - .atn { - color: #f5871f; } - - /* a markup attribute value */ - .atv { - color: #3e999f; } - - /* a declaration */ - .dec { - color: #f5871f; } - - /* a variable name */ - .var { - color: #c82829; } - - /* a function name */ - .fun { - color: #4271ae; } } -/* Use higher contrast and text-weight for printable form. */ -@media print, projection { - .str { - color: #060; } - - .kwd { - color: #006; - font-weight: bold; } - - .com { - color: #600; - font-style: italic; } - - .typ { - color: #404; - font-weight: bold; } - - .lit { - color: #044; } - - .pun, .opn, .clo { - color: #440; } - - .tag { - color: #006; - font-weight: bold; } - - .atn { - color: #404; } - - .atv { - color: #060; } } -/* Style */ -/* -pre.prettyprint { - background: white; - font-family: Menlo, Monaco, Consolas, monospace; - font-size: 12px; - line-height: 1.5; - border: 1px solid #ccc; - padding: 10px; } -*/ - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin-top: 0; - margin-bottom: 0; } - -/* IE indents via margin-left */ -li.L0, -li.L1, -li.L2, -li.L3, -li.L4, -li.L5, -li.L6, -li.L7, -li.L8, -li.L9 { - /* */ } - -/* Alternate shading for lines */ -li.L1, -li.L3, -li.L5, -li.L7, -li.L9 { - /* */ } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/container.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/container.tmpl deleted file mode 100644 index 173b043..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/container.tmpl +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - -
    - -
    -

    - - - - - -

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

    Example 1? 's':'' ?>

    - - - -
    - - -

    Extends

    - -
      -
    • -
    - - - -

    Mixes In

    - -
      -
    • -
    - - - -

    Requires

    - -
      -
    • -
    - - - -

    Classes

    - -
    -
    -
    -
    - - - -

    Mixins

    - -
    -
    -
    -
    - - - -

    Namespaces

    - -
    -
    -
    -
    - - - -

    Members

    - -
    - -
    - - - -

    Methods

    - -
    - -
    - - - -

    Type Definitions

    - -
    - - - -
    - - - -

    Events

    - -
    - -
    - -
    - -
    - - - diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/details.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/details.tmpl deleted file mode 100644 index 1ee86d2..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/details.tmpl +++ /dev/null @@ -1,107 +0,0 @@ -" + data.defaultvalue + ""; - defaultObjectClass = ' class="object-value"'; -} -?> -
    - - -
    Properties:
    - -
    - - - - -
    Version:
    -
    - - - -
    Since:
    -
    - - - -
    Inherited From:
    -
    • - -
    - - - -
    Deprecated:
    • Yes
      - - - -
      Author:
      -
      -
        -
      • -
      -
      - - - - - - - - -
      License:
      -
      - - - -
      Default Value:
      -
        - > -
      - - - -
      Source:
      -
      • - , -
      - - - -
      Tutorials:
      -
      -
        -
      • -
      -
      - - - -
      See:
      -
      -
        -
      • -
      -
      - - - -
      To Do:
      -
      -
        -
      • -
      -
      - -
      diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/example.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/example.tmpl deleted file mode 100644 index e87caa5..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/example.tmpl +++ /dev/null @@ -1,2 +0,0 @@ - -
      diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/examples.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/examples.tmpl deleted file mode 100644 index 04d975e..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/examples.tmpl +++ /dev/null @@ -1,13 +0,0 @@ - -

      - -
      - \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl deleted file mode 100644 index 78c4e25..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl +++ /dev/null @@ -1,30 +0,0 @@ - - -
      -
      -
      - -
      -
      -
      -
      -
      - Type -
      -
      - -
      -
      -
      -
      - -
      - - - - - -
      - diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/layout.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/layout.tmpl deleted file mode 100644 index 92cd6ee..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/layout.tmpl +++ /dev/null @@ -1,38 +0,0 @@ - - - - - JSDoc: <?js= title ?> - - - - - - - - - - -
      - -

      - - -
      - - - -
      - -
      - Documentation generated by JSDoc on -
      - - - - - diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl deleted file mode 100644 index 64e9e59..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/mainpage.tmpl +++ /dev/null @@ -1,14 +0,0 @@ - - - -

      - - - -
      -
      -
      - diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/members.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/members.tmpl deleted file mode 100644 index 0f99998..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/members.tmpl +++ /dev/null @@ -1,41 +0,0 @@ - -
      -

      - - -

      - -
      -
      - -
      - -
      - - - -
      Type:
      -
        -
      • - -
      • -
      - - - - - -
      Fires:
      -
        -
      • -
      - - - -
      Example 1? 's':'' ?>
      - - -
      diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/method.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/method.tmpl deleted file mode 100644 index ff51758..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/method.tmpl +++ /dev/null @@ -1,97 +0,0 @@ - -
      -

      - - -

      - -
      -
      - - -
      - -
      - - - -
      Type:
      -
        -
      • - -
      • -
      - - - -
      This:
      -
      - - - -
      Parameters:
      - - - - - - -
      Requires:
      -
        -
      • -
      - - - -
      Fires:
      -
        -
      • -
      - - - -
      Listens to Events:
      -
        -
      • -
      - - - -
      Listeners of This Event:
      -
        -
      • -
      - - - -
      Throws:
      - 1) { ?>
        -
      • -
      - - - - -
      Returns:
      - 1) { ?>
        -
      • -
      - - - - -
      Example 1? 's':'' ?>
      - - -
      diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/params.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/params.tmpl deleted file mode 100644 index 66ab045..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/params.tmpl +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      NameTypeAttributesDefaultDescription
      - - - - - - <optional>
      - - - - <nullable>
      - - - - <repeatable>
      - -
      - - - - -
      Properties
      - -
      \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/properties.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/properties.tmpl deleted file mode 100644 index 58f412f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/properties.tmpl +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      NameTypeAttributesDefaultDescription
      - - - - - - <optional>
      - - - - <nullable>
      - -
      - - - - -
      Properties
      -
      \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/returns.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/returns.tmpl deleted file mode 100644 index d070459..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/returns.tmpl +++ /dev/null @@ -1,19 +0,0 @@ - -
      - -
      - - - -
      -
      - Type -
      -
      - -
      -
      - \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/source.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/source.tmpl deleted file mode 100644 index e559b5d..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/source.tmpl +++ /dev/null @@ -1,8 +0,0 @@ - -
      -
      -
      -
      -
      \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl deleted file mode 100644 index 88a0ad5..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/tutorial.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -
      - -
      - 0) { ?> -
        -
      • -
      - - -

      -
      - -
      - -
      - -
      diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/type.tmpl b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/type.tmpl deleted file mode 100644 index ec2c6c0..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/default/tmpl/type.tmpl +++ /dev/null @@ -1,7 +0,0 @@ - - -| - \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/haruki/README.md b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/haruki/README.md deleted file mode 100644 index ee6d36f..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/haruki/README.md +++ /dev/null @@ -1,39 +0,0 @@ -OVERVIEW -======== - -JSDoc 3 Haruki is an experimental template optimised for use with publishing processes that consume either JSON or XML. Whereas the default JSDoc template outputs an HTML representation of your API, Haruki will output a JSON, or optionally an XML, representation. - -Currently Haruki only supports a subset of the tags supported by the default template. Those are: - - * @name - * @desc - * @type - * @namespace - * @method (or @function) - * @member (or @var) - * @class - * @mixin - * @event - * @param - * @returns - * @throws - * @example - * @access (like @private or @public) - -This limited support set is intentional, as it is meant to be a usable set that could be shared with either JavaScript or PHP documentation -- another experimental tool, named "Vonnegut", can produce Haruki compatible JSON from PHPDoc tags. - -Note: `@link`s will appear in the output untransformed, there is no way to know at this stage what the file layout of your output will eventually be. It is assumed that whatever process emits the final output file/s will transform `@link` tags at that point. - -USAGE -===== - - ./jsdoc myscript.js -t templates/haruki -d console -q format=xml - -The results of this command will appear in `stdout` and can be piped into other tools for further processing. - -MORE -===== - -If you are interested in Haruki, you are encouraged to discuss your questions or ideas on the JSDoc-Users mailing list and fork/contribute to this project. - -For more information contact Michael Mathews at . \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/haruki/publish.js b/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/haruki/publish.js deleted file mode 100644 index cf9ec01..0000000 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/templates/haruki/publish.js +++ /dev/null @@ -1,222 +0,0 @@ -/*eslint no-nested-ternary:0, space-infix-ops: 0 */ -/** - @overview Builds a tree-like JSON string from the doclet data. - @version 0.0.3 - @example - ./jsdoc scratch/jsdoc_test.js -t templates/haruki -d console -q format=xml - */ -'use strict'; - -function graft(parentNode, childNodes, parentLongname, parentName) { - childNodes - .filter(function (element) { - return (element.memberof === parentLongname); - }) - .forEach(function (element, index) { - var i, - len; - - if (element.kind === 'namespace') { - if (! parentNode.namespaces) { - parentNode.namespaces = []; - } - - var thisNamespace = { - 'name': element.name, - 'description': element.description || '', - 'access': element.access || '', - 'virtual': !!element.virtual - }; - - parentNode.namespaces.push(thisNamespace); - - graft(thisNamespace, childNodes, element.longname, element.name); - } - else if (element.kind === 'mixin') { - if (! parentNode.mixins) { - parentNode.mixins = []; - } - - var thisMixin = { - 'name': element.name, - 'description': element.description || '', - 'access': element.access || '', - 'virtual': !!element.virtual - }; - - parentNode.mixins.push(thisMixin); - - graft(thisMixin, childNodes, element.longname, element.name); - } - else if (element.kind === 'function') { - if (! parentNode.functions) { - parentNode.functions = []; - } - - var thisFunction = { - 'name': element.name, - 'access': element.access || '', - 'virtual': !!element.virtual, - 'description': element.description || '', - 'parameters': [ ], - 'examples': [] - }; - - parentNode.functions.push(thisFunction); - - if (element.returns) { - thisFunction.returns = { - 'type': element.returns[0].type? (element.returns[0].type.names.length === 1? element.returns[0].type.names[0] : element.returns[0].type.names) : '', - 'description': element.returns[0].description || '' - }; - } - - if (element.examples) { - for (i = 0, len = element.examples.length; i < len; i++) { - thisFunction.examples.push(element.examples[i]); - } - } - - if (element.params) { - for (i = 0, len = element.params.length; i < len; i++) { - thisFunction.parameters.push({ - 'name': element.params[i].name, - 'type': element.params[i].type? (element.params[i].type.names.length === 1? element.params[i].type.names[0] : element.params[i].type.names) : '', - 'description': element.params[i].description || '', - 'default': element.params[i].defaultvalue || '', - 'optional': typeof element.params[i].optional === 'boolean'? element.params[i].optional : '', - 'nullable': typeof element.params[i].nullable === 'boolean'? element.params[i].nullable : '' - }); - } - } - } - else if (element.kind === 'member') { - if (! parentNode.properties) { - parentNode.properties = []; - } - parentNode.properties.push({ - 'name': element.name, - 'access': element.access || '', - 'virtual': !!element.virtual, - 'description': element.description || '', - 'type': element.type? (element.type.length === 1? element.type[0] : element.type) : '' - }); - } - - else if (element.kind === 'event') { - if (! parentNode.events) { - parentNode.events = []; - } - - var thisEvent = { - 'name': element.name, - 'access': element.access || '', - 'virtual': !!element.virtual, - 'description': element.description || '', - 'parameters': [], - 'examples': [] - }; - - parentNode.events.push(thisEvent); - - if (element.returns) { - thisEvent.returns = { - 'type': element.returns.type? (element.returns.type.names.length === 1? element.returns.type.names[0] : element.returns.type.names) : '', - 'description': element.returns.description || '' - }; - } - - if (element.examples) { - for (i = 0, len = element.examples.length; i < len; i++) { - thisEvent.examples.push(element.examples[i]); - } - } - - if (element.params) { - for (i = 0, len = element.params.length; i < len; i++) { - thisEvent.parameters.push({ - 'name': element.params[i].name, - 'type': element.params[i].type? (element.params[i].type.names.length === 1? element.params[i].type.names[0] : element.params[i].type.names) : '', - 'description': element.params[i].description || '', - 'default': element.params[i].defaultvalue || '', - 'optional': typeof element.params[i].optional === 'boolean'? element.params[i].optional : '', - 'nullable': typeof element.params[i].nullable === 'boolean'? element.params[i].nullable : '' - }); - } - } - } - else if (element.kind === 'class') { - if (! parentNode.classes) { - parentNode.classes = []; - } - - var thisClass = { - 'name': element.name, - 'description': element.classdesc || '', - 'extends': element.augments || [], - 'access': element.access || '', - 'virtual': !!element.virtual, - 'fires': element.fires || '', - 'constructor': { - 'name': element.name, - 'description': element.description || '', - 'parameters': [ - ], - 'examples': [] - } - }; - - parentNode.classes.push(thisClass); - - if (element.examples) { - for (i = 0, len = element.examples.length; i < len; i++) { - thisClass.constructor.examples.push(element.examples[i]); - } - } - - if (element.params) { - for (i = 0, len = element.params.length; i < len; i++) { - thisClass.constructor.parameters.push({ - 'name': element.params[i].name, - 'type': element.params[i].type? (element.params[i].type.names.length === 1? element.params[i].type.names[0] : element.params[i].type.names) : '', - 'description': element.params[i].description || '', - 'default': element.params[i].defaultvalue || '', - 'optional': typeof element.params[i].optional === 'boolean'? element.params[i].optional : '', - 'nullable': typeof element.params[i].nullable === 'boolean'? element.params[i].nullable : '' - }); - } - } - - graft(thisClass, childNodes, element.longname, element.name); - } - }); -} - -/** - @param {TAFFY} data - @param {object} opts - */ -exports.publish = function(data, opts) { - - var root = {}, - docs; - - data({undocumented: true}).remove(); - docs = data().get(); // <-- an array of Doclet objects - - graft(root, docs); - - if (opts.destination === 'console') { - if (opts.query && opts.query.format === 'xml') { - var xml = require('js2xmlparser'); - console.log( xml('jsdoc', root) ); - } - else { - global.dump(root); - } - } - else { - console.log('This template only supports output to the console. Use the option "-d console" when you run JSDoc.'); - } - -}; diff --git a/node_modules/grunt-jsdoc/package.json b/node_modules/grunt-jsdoc/package.json index 8fede3e..a745df2 100644 --- a/node_modules/grunt-jsdoc/package.json +++ b/node_modules/grunt-jsdoc/package.json @@ -62,7 +62,7 @@ "gitHead": "fda5174fad8f1972a818e9f1fadedcad0af2703a", "_id": "grunt-jsdoc@0.6.1", "_shasum": "fe30b0c96813bcffb3d5a4e36f849a0c91bcb009", - "_from": "grunt-jsdoc@beta", + "_from": "grunt-jsdoc@0.6.1", "_npmVersion": "2.1.2", "_nodeVersion": "0.10.32", "_npmUser": { @@ -80,5 +80,6 @@ "tarball": "http://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-0.6.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-0.6.1.tgz" + "_resolved": "https://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-0.6.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt/node_modules/async/package.json b/node_modules/grunt/node_modules/async/package.json index afac978..66cbf73 100644 --- a/node_modules/grunt/node_modules/async/package.json +++ b/node_modules/grunt/node_modules/async/package.json @@ -28,5 +28,6 @@ "readmeFilename": "README.md", "homepage": "https://github.com/caolan/async", "_id": "async@0.1.22", - "_from": "async@>=0.1.22 <0.2.0" + "_from": "async@0.1.22", + "scripts": {} } diff --git a/node_modules/grunt/node_modules/coffee-script/package.json b/node_modules/grunt/node_modules/coffee-script/package.json index 1bfa1f0..019fbf4 100644 --- a/node_modules/grunt/node_modules/coffee-script/package.json +++ b/node_modules/grunt/node_modules/coffee-script/package.json @@ -43,5 +43,5 @@ "readme": "\n {\n } } {\n { { } }\n } }{ {\n { }{ } } _____ __ __\n ( }{ }{ { ) / ____| / _|/ _|\n .- { { } { }} -. | | ___ | |_| |_ ___ ___\n ( ( } { } { } } ) | | / _ \\| _| _/ _ \\/ _ \\\n |`-..________ ..-'| | |___| (_) | | | || __/ __/\n | | \\_____\\___/|_| |_| \\___|\\___|\n | ;--.\n | (__ \\ _____ _ _\n | | ) ) / ____| (_) | |\n | |/ / | (___ ___ _ __ _ _ __ | |_\n | ( / \\___ \\ / __| '__| | '_ \\| __|\n | |/ ____) | (__| | | | |_) | |_\n | | |_____/ \\___|_| |_| .__/ \\__|\n `-.._________..-' | |\n |_|\n\n\n CoffeeScript is a little language that compiles into JavaScript.\n\n Install Node.js, and then the CoffeeScript compiler:\n sudo bin/cake install\n\n Or, if you have the Node Package Manager installed:\n npm install -g coffee-script\n (Leave off the -g if you don't wish to install globally.)\n\n Execute a script:\n coffee /path/to/script.coffee\n\n Compile a script:\n coffee -c /path/to/script.coffee\n\n For documentation, usage, and examples, see:\n http://coffeescript.org/\n\n To suggest a feature, report a bug, or general discussion:\n http://github.com/jashkenas/coffee-script/issues/\n\n If you'd like to chat, drop by #coffeescript on Freenode IRC,\n or on webchat.freenode.net.\n\n The source repository:\n git://github.com/jashkenas/coffee-script.git\n\n All contributors are listed here:\n http://github.com/jashkenas/coffee-script/contributors\n", "readmeFilename": "README", "_id": "coffee-script@1.3.3", - "_from": "coffee-script@>=1.3.3 <1.4.0" + "_from": "coffee-script@1.3.3" } diff --git a/node_modules/grunt/node_modules/colors/package.json b/node_modules/grunt/node_modules/colors/package.json index 2a61e7d..aed2337 100644 --- a/node_modules/grunt/node_modules/colors/package.json +++ b/node_modules/grunt/node_modules/colors/package.json @@ -25,6 +25,6 @@ "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", "readmeFilename": "ReadMe.md", "_id": "colors@0.6.2", - "_from": "colors@>=0.6.2 <0.7.0", + "_from": "colors@0.6.2", "scripts": {} } diff --git a/node_modules/grunt/node_modules/dateformat/package.json b/node_modules/grunt/node_modules/dateformat/package.json index dbe9490..9a8a5dd 100644 --- a/node_modules/grunt/node_modules/dateformat/package.json +++ b/node_modules/grunt/node_modules/dateformat/package.json @@ -37,5 +37,7 @@ "directories": {}, "_shasum": "b0220c02de98617433b72851cf47de3df2cdbee9", "_from": "dateformat@1.0.2-1.2.3", - "_resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz" + "_resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", + "readme": "# node-dateformat\n\nA node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.\n\n## Modifications\n\n* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.\n* Added a `module.exports = dateFormat;` statement at the bottom\n\n## Usage\n\nAs taken from Steven's post, modified to match the Modifications listed above:\n\n var dateFormat = require('dateformat');\n var now = new Date();\n\n // Basic usage\n dateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\");\n // Saturday, June 9th, 2007, 5:46:21 PM\n\n // You can use one of several named masks\n dateFormat(now, \"isoDateTime\");\n // 2007-06-09T17:46:21\n\n // ...Or add your own\n dateFormat.masks.hammerTime = 'HH:MM! \"Can\\'t touch this!\"';\n dateFormat(now, \"hammerTime\");\n // 17:46! Can't touch this!\n\n // When using the standalone dateFormat function,\n // you can also provide the date as a string\n dateFormat(\"Jun 9 2007\", \"fullDate\");\n // Saturday, June 9, 2007\n\n // Note that if you don't include the mask argument,\n // dateFormat.masks.default is used\n dateFormat(now);\n // Sat Jun 09 2007 17:46:21\n\n // And if you don't include the date argument,\n // the current date and time is used\n dateFormat();\n // Sat Jun 09 2007 17:46:22\n\n // You can also skip the date argument (as long as your mask doesn't\n // contain any numbers), in which case the current date/time is used\n dateFormat(\"longTime\");\n // 5:46:22 PM EST\n\n // And finally, you can convert local time to UTC time. Simply pass in\n // true as an additional argument (no argument skipping allowed in this case):\n dateFormat(now, \"longTime\", true);\n // 10:46:21 PM UTC\n\n // ...Or add the prefix \"UTC:\" to your mask.\n dateFormat(now, \"UTC:h:MM:ss TT Z\");\n // 10:46:21 PM UTC\n\n // You can also get the ISO 8601 week of the year:\n dateFormat(now, \"W\");\n // 42\n## License\n\n(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.\n\n[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format\n[stevenlevithan]: http://stevenlevithan.com/\n", + "readmeFilename": "Readme.md" } diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/glob/package.json b/node_modules/grunt/node_modules/findup-sync/node_modules/glob/package.json index cbd0dd6..de105e7 100644 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/glob/package.json +++ b/node_modules/grunt/node_modules/findup-sync/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.2.9 <3.3.0", + "_from": "glob@3.2.11", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt/node_modules/glob/package.json b/node_modules/grunt/node_modules/glob/package.json index e55603f..54d0c76 100644 --- a/node_modules/grunt/node_modules/glob/package.json +++ b/node_modules/grunt/node_modules/glob/package.json @@ -36,5 +36,5 @@ }, "homepage": "https://github.com/isaacs/node-glob", "_id": "glob@3.1.21", - "_from": "glob@>=3.1.21 <3.2.0" + "_from": "glob@3.1.21" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/LICENSE b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt similarity index 93% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/LICENSE rename to node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt index a85a94a..7dca107 100644 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/wrench/LICENSE +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt @@ -1,6 +1,7 @@ -The MIT License +Copyright (c) 2010 -Copyright (c) 2010 Ryan McGrath +Marak Squires +Alexis Sellier (cloudhead) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 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. \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md new file mode 100644 index 0000000..0eda52d --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md @@ -0,0 +1,77 @@ +# colors.js - get color and style in your node.js console ( and browser ) like what + + + + +## Installation + + npm install colors + +## colors and styles! + +- bold +- italic +- underline +- inverse +- yellow +- cyan +- white +- magenta +- green +- red +- grey +- blue +- rainbow +- zebra +- random + +## Usage + +``` js +var colors = require('./colors'); + +console.log('hello'.green); // outputs green text +console.log('i like cake and pies'.underline.red) // outputs red underlined text +console.log('inverse the color'.inverse); // inverses the color +console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) +``` + +# Creating Custom themes + +```js + +var colors = require('colors'); + +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}); + +// outputs red text +console.log("this is an error".error); + +// outputs yellow text +console.log("this is a warning".warn); +``` + + +### Contributors + +Marak (Marak Squires) +Alexis Sellier (cloudhead) +mmalecki (Maciej Małecki) +nicoreed (Nico Reed) +morganrallen (Morgan Allen) +JustinCampbell (Justin Campbell) +ded (Dustin Diaz) + + +#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js new file mode 100644 index 0000000..7a537d8 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js @@ -0,0 +1,342 @@ +/* +colors.js + +Copyright (c) 2010 + +Marak Squires +Alexis Sellier (cloudhead) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +var isHeadless = false; + +if (typeof module !== 'undefined') { + isHeadless = true; +} + +if (!isHeadless) { + var exports = {}; + var module = {}; + var colors = exports; + exports.mode = "browser"; +} else { + exports.mode = "console"; +} + +// +// Prototypes the string object to have additional method calls that add terminal colors +// +var addProperty = function (color, func) { + exports[color] = function (str) { + return func.apply(str); + }; + String.prototype.__defineGetter__(color, func); +}; + +function stylize(str, style) { + + var styles; + + if (exports.mode === 'console') { + styles = { + //styles + 'bold' : ['\x1B[1m', '\x1B[22m'], + 'italic' : ['\x1B[3m', '\x1B[23m'], + 'underline' : ['\x1B[4m', '\x1B[24m'], + 'inverse' : ['\x1B[7m', '\x1B[27m'], + 'strikethrough' : ['\x1B[9m', '\x1B[29m'], + //text colors + //grayscale + 'white' : ['\x1B[37m', '\x1B[39m'], + 'grey' : ['\x1B[90m', '\x1B[39m'], + 'black' : ['\x1B[30m', '\x1B[39m'], + //colors + 'blue' : ['\x1B[34m', '\x1B[39m'], + 'cyan' : ['\x1B[36m', '\x1B[39m'], + 'green' : ['\x1B[32m', '\x1B[39m'], + 'magenta' : ['\x1B[35m', '\x1B[39m'], + 'red' : ['\x1B[31m', '\x1B[39m'], + 'yellow' : ['\x1B[33m', '\x1B[39m'], + //background colors + //grayscale + 'whiteBG' : ['\x1B[47m', '\x1B[49m'], + 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'], + 'blackBG' : ['\x1B[40m', '\x1B[49m'], + //colors + 'blueBG' : ['\x1B[44m', '\x1B[49m'], + 'cyanBG' : ['\x1B[46m', '\x1B[49m'], + 'greenBG' : ['\x1B[42m', '\x1B[49m'], + 'magentaBG' : ['\x1B[45m', '\x1B[49m'], + 'redBG' : ['\x1B[41m', '\x1B[49m'], + 'yellowBG' : ['\x1B[43m', '\x1B[49m'] + }; + } else if (exports.mode === 'browser') { + styles = { + //styles + 'bold' : ['', ''], + 'italic' : ['', ''], + 'underline' : ['', ''], + 'inverse' : ['', ''], + 'strikethrough' : ['', ''], + //text colors + //grayscale + 'white' : ['', ''], + 'grey' : ['', ''], + 'black' : ['', ''], + //colors + 'blue' : ['', ''], + 'cyan' : ['', ''], + 'green' : ['', ''], + 'magenta' : ['', ''], + 'red' : ['', ''], + 'yellow' : ['', ''], + //background colors + //grayscale + 'whiteBG' : ['', ''], + 'greyBG' : ['', ''], + 'blackBG' : ['', ''], + //colors + 'blueBG' : ['', ''], + 'cyanBG' : ['', ''], + 'greenBG' : ['', ''], + 'magentaBG' : ['', ''], + 'redBG' : ['', ''], + 'yellowBG' : ['', ''] + }; + } else if (exports.mode === 'none') { + return str + ''; + } else { + console.log('unsupported mode, try "browser", "console" or "none"'); + } + return styles[style][0] + str + styles[style][1]; +} + +function applyTheme(theme) { + + // + // Remark: This is a list of methods that exist + // on String that you should not overwrite. + // + var stringPrototypeBlacklist = [ + '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', + 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', + 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', + 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' + ]; + + Object.keys(theme).forEach(function (prop) { + if (stringPrototypeBlacklist.indexOf(prop) !== -1) { + console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); + } + else { + if (typeof(theme[prop]) === 'string') { + addProperty(prop, function () { + return exports[theme[prop]](this); + }); + } + else { + addProperty(prop, function () { + var ret = this; + for (var t = 0; t < theme[prop].length; t++) { + ret = exports[theme[prop][t]](ret); + } + return ret; + }); + } + } + }); +} + + +// +// Iterate through all default styles and colors +// +var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG']; +x.forEach(function (style) { + + // __defineGetter__ at the least works in more browsers + // http://robertnyman.com/javascript/javascript-getters-setters.html + // Object.defineProperty only works in Chrome + addProperty(style, function () { + return stylize(this, style); + }); +}); + +function sequencer(map) { + return function () { + if (!isHeadless) { + return this.replace(/( )/, '$1'); + } + var exploded = this.split(""), i = 0; + exploded = exploded.map(map); + return exploded.join(""); + }; +} + +var rainbowMap = (function () { + var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV + return function (letter, i, exploded) { + if (letter === " ") { + return letter; + } else { + return stylize(letter, rainbowColors[i++ % rainbowColors.length]); + } + }; +})(); + +exports.themes = {}; + +exports.addSequencer = function (name, map) { + addProperty(name, sequencer(map)); +}; + +exports.addSequencer('rainbow', rainbowMap); +exports.addSequencer('zebra', function (letter, i, exploded) { + return i % 2 === 0 ? letter : letter.inverse; +}); + +exports.setTheme = function (theme) { + if (typeof theme === 'string') { + try { + exports.themes[theme] = require(theme); + applyTheme(exports.themes[theme]); + return exports.themes[theme]; + } catch (err) { + console.log(err); + return err; + } + } else { + applyTheme(theme); + } +}; + + +addProperty('stripColors', function () { + return ("" + this).replace(/\x1B\[\d+m/g, ''); +}); + +// please no +function zalgo(text, options) { + var soul = { + "up" : [ + '̍', '̎', '̄', '̅', + '̿', '̑', '̆', '̐', + '͒', '͗', '͑', '̇', + '̈', '̊', '͂', '̓', + '̈', '͊', '͋', '͌', + '̃', '̂', '̌', '͐', + '̀', '́', '̋', '̏', + '̒', '̓', '̔', '̽', + '̉', 'ͣ', 'ͤ', 'ͥ', + 'ͦ', 'ͧ', 'ͨ', 'ͩ', + 'ͪ', 'ͫ', 'ͬ', 'ͭ', + 'ͮ', 'ͯ', '̾', '͛', + '͆', '̚' + ], + "down" : [ + '̖', '̗', '̘', '̙', + '̜', '̝', '̞', '̟', + '̠', '̤', '̥', '̦', + '̩', '̪', '̫', '̬', + '̭', '̮', '̯', '̰', + '̱', '̲', '̳', '̹', + '̺', '̻', '̼', 'ͅ', + '͇', '͈', '͉', '͍', + '͎', '͓', '͔', '͕', + '͖', '͙', '͚', '̣' + ], + "mid" : [ + '̕', '̛', '̀', '́', + '͘', '̡', '̢', '̧', + '̨', '̴', '̵', '̶', + '͜', '͝', '͞', + '͟', '͠', '͢', '̸', + '̷', '͡', ' ҉' + ] + }, + all = [].concat(soul.up, soul.down, soul.mid), + zalgo = {}; + + function randomNumber(range) { + var r = Math.floor(Math.random() * range); + return r; + } + + function is_char(character) { + var bool = false; + all.filter(function (i) { + bool = (i === character); + }); + return bool; + } + + function heComes(text, options) { + var result = '', counts, l; + options = options || {}; + options["up"] = options["up"] || true; + options["mid"] = options["mid"] || true; + options["down"] = options["down"] || true; + options["size"] = options["size"] || "maxi"; + text = text.split(''); + for (l in text) { + if (is_char(l)) { + continue; + } + result = result + text[l]; + counts = {"up" : 0, "down" : 0, "mid" : 0}; + switch (options.size) { + case 'mini': + counts.up = randomNumber(8); + counts.min = randomNumber(2); + counts.down = randomNumber(8); + break; + case 'maxi': + counts.up = randomNumber(16) + 3; + counts.min = randomNumber(4) + 1; + counts.down = randomNumber(64) + 3; + break; + default: + counts.up = randomNumber(8) + 1; + counts.mid = randomNumber(6) / 2; + counts.down = randomNumber(8) + 1; + break; + } + + var arr = ["up", "mid", "down"]; + for (var d in arr) { + var index = arr[d]; + for (var i = 0 ; i <= counts[index]; i++) { + if (options[index]) { + result = result + soul[index][randomNumber(soul[index].length)]; + } + } + } + } + return result; + } + return heComes(text); +} + + +// don't summon zalgo +addProperty('zalgo', function () { + return zalgo(this); +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html new file mode 100644 index 0000000..7a2ae60 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html @@ -0,0 +1,76 @@ + + + + + Colors Example + + + + + + \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js new file mode 100644 index 0000000..b1e03a4 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js @@ -0,0 +1,77 @@ +var colors = require('./colors'); + +//colors.mode = "browser"; + +var test = colors.red("hopefully colorless output"); +console.log('Rainbows are fun!'.rainbow); +console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported +console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported +//console.log('zalgo time!'.zalgo); +console.log(test.stripColors); +console.log("a".grey + " b".black); +console.log("Zebras are so fun!".zebra); +console.log('background color attack!'.black.whiteBG) + +// +// Remark: .strikethrough may not work with Mac OS Terminal App +// +console.log("This is " + "not".strikethrough + " fun."); +console.log(colors.rainbow('Rainbows are fun!')); +console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported +console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported +//console.log(colors.zalgo('zalgo time!')); +console.log(colors.stripColors(test)); +console.log(colors.grey("a") + colors.black(" b")); + +colors.addSequencer("america", function(letter, i, exploded) { + if(letter === " ") return letter; + switch(i%3) { + case 0: return letter.red; + case 1: return letter.white; + case 2: return letter.blue; + } +}); + +colors.addSequencer("random", (function() { + var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; + + return function(letter, i, exploded) { + return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; + }; +})()); + +console.log("AMERICA! F--K YEAH!".america); +console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); + +// +// Custom themes +// + +// Load theme with JSON literal +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}); + +// outputs red text +console.log("this is an error".error); + +// outputs yellow text +console.log("this is a warning".warn); + +// outputs grey text +console.log("this is an input".input); + +// Load a theme from file +colors.setTheme('./themes/winston-dark.js'); + +console.log("this is an input".input); + diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json new file mode 100644 index 0000000..aed2337 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json @@ -0,0 +1,30 @@ +{ + "name": "colors", + "description": "get colors in your node.js console like what", + "version": "0.6.2", + "author": { + "name": "Marak Squires" + }, + "homepage": "https://github.com/Marak/colors.js", + "bugs": { + "url": "https://github.com/Marak/colors.js/issues" + }, + "keywords": [ + "ansi", + "terminal", + "colors" + ], + "repository": { + "type": "git", + "url": "http://github.com/Marak/colors.js.git" + }, + "engines": { + "node": ">=0.1.90" + }, + "main": "colors", + "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", + "readmeFilename": "ReadMe.md", + "_id": "colors@0.6.2", + "_from": "colors@0.6.2", + "scripts": {} +} diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js new file mode 100644 index 0000000..c32417d --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js @@ -0,0 +1,70 @@ +var assert = require('assert'), + colors = require('./colors'); + +var s = 'string'; + +function a(s, code) { + return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; +} + +function aE(s, color, code) { + assert.equal(s[color], a(s, code)); + assert.equal(colors[color](s), a(s, code)); + assert.equal(s[color], colors[color](s)); + assert.equal(s[color].stripColors, s); + assert.equal(s[color].stripColors, colors.stripColors(s)); +} + +function h(s, color) { + return '' + s + ''; +} + +var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; +var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); + +colors.mode = 'console'; +assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); +assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); +assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); +assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); +assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); +assert.ok(s.rainbow); +aE(s, 'white', 37); +aE(s, 'grey', 90); +aE(s, 'black', 30); +aE(s, 'blue', 34); +aE(s, 'cyan', 36); +aE(s, 'green', 32); +aE(s, 'magenta', 35); +aE(s, 'red', 31); +aE(s, 'yellow', 33); +assert.equal(s, 'string'); + +colors.setTheme({error:'red'}); + +assert.equal(typeof("astring".red),'string'); +assert.equal(typeof("astring".error),'string'); + +colors.mode = 'browser'; +assert.equal(s.bold, '' + s + ''); +assert.equal(s.italic, '' + s + ''); +assert.equal(s.underline, '' + s + ''); +assert.equal(s.strikethrough, '' + s + ''); +assert.equal(s.inverse, '' + s + ''); +assert.ok(s.rainbow); +stylesColors.forEach(function (color) { + assert.equal(s[color], h(s, color)); + assert.equal(colors[color](s), h(s, color)); +}); + +assert.equal(typeof("astring".red),'string'); +assert.equal(typeof("astring".error),'string'); + +colors.mode = 'none'; +stylesAll.forEach(function (style) { + assert.equal(s[style], s); + assert.equal(colors[style](s), s); +}); + +assert.equal(typeof("astring".red),'string'); +assert.equal(typeof("astring".error),'string'); diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js new file mode 100644 index 0000000..49a905b --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js @@ -0,0 +1,12 @@ +module['exports'] = { + silly: 'rainbow', + input: 'black', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js new file mode 100644 index 0000000..571972c --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js @@ -0,0 +1,12 @@ +module['exports'] = { + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}; \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/.gitmodules b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.gitmodules similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/.gitmodules rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.gitmodules diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/.npmignore b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.npmignore similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/.npmignore rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.npmignore diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/LICENSE b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/LICENSE similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/LICENSE rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/LICENSE diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/Makefile b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/Makefile similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/Makefile rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/Makefile diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/README.md b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/README.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/README.md rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/README.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/index.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/index.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/index.js rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/index.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/lib/async.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/lib/async.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/lib/async.js rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/lib/async.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/package.json b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json similarity index 99% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/package.json rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json index afac978..66cbf73 100644 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/async/package.json +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json @@ -28,5 +28,6 @@ "readmeFilename": "README.md", "homepage": "https://github.com/caolan/async", "_id": "async@0.1.22", - "_from": "async@>=0.1.22 <0.2.0" + "_from": "async@0.1.22", + "scripts": {} } diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md new file mode 100644 index 0000000..55dae80 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md @@ -0,0 +1,140 @@ +# Lo-Dash v0.9.2 + +A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). + +## Download + + * [Development build](https://raw.github.com/lodash/lodash/0.9.2/lodash.js) + * [Production build](https://raw.github.com/lodash/lodash/0.9.2/lodash.min.js) + * [Underscore build](https://raw.github.com/lodash/lodash/0.9.2/lodash.underscore.min.js) tailored for projects already using Underscore + * CDN copies of ≤ v0.9.2’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/) + * For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need + +## Dive in + +We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). + +Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones. + +For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). + +## Screencasts + +For more information check out these screencasts over Lo-Dash: + + * [Introducing Lo-Dash](https://vimeo.com/44154599) + * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) + * [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) + * [Unit testing in Lo-Dash](https://vimeo.com/45865290) + * [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) + +## Features + + * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) + * [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning + * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument + * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early + * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties + * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor + * [_.lateBind](http://lodash.com/docs#lateBind) for late binding + * [_.merge](http://lodash.com/docs#merge) for a *“deep”* [_.extend](http://lodash.com/docs#extend) + * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding + * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments + * [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging + * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), + [and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings + +## Support + +Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. + +## Installation and usage + +In browsers: + +```html + +``` + +Using [npm](http://npmjs.org/): + +```bash +npm install lodash + +npm install -g lodash +npm link lodash +``` + +In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): + +```js +var _ = require('lodash'); +``` + +**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it. + +In [RingoJS v0.7.0-](http://ringojs.org/): + +```js +var _ = require('lodash')._; +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({ + 'paths': { + 'underscore': 'path/to/lodash' + } +}, +['underscore'], function(_) { + console.log(_.VERSION); +}); +``` + +## Resolved Underscore.js issues + + * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L545-551)] + * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L558-582)] + * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L140-146)] + * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L747-752)] + * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L828-840)] + * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L921-923)] + * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L1337-1340)] + +## Release Notes + +### v0.9.2 + + * Added `fromIndex` argument to `_.contains` + * Added `moduleId` build option + * Added Closure Compiler *“simple”* optimizations to the build process + * Added support for strings in `_.max` and `_.min` + * Added support for ES6 template delimiters to `_.template` + * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs + * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq` + +The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). + +## BestieJS + +Lo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js new file mode 100644 index 0000000..9eae931 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js @@ -0,0 +1,4258 @@ +/*! + * Lo-Dash v0.9.2 + * (c) 2012 John-David Dalton + * Based on Underscore.js 1.4.2 + * (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. + * Available under MIT license + */ +;(function(window, undefined) { + + /** Detect free variable `exports` */ + var freeExports = typeof exports == 'object' && exports; + + /** Detect free variable `global` and use it as `window` */ + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal) { + window = freeGlobal; + } + + /** Used for array and object method references */ + var arrayRef = [], + // avoid a Closure Compiler bug by creatively creating an object + objectRef = new function(){}; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = objectRef; + + /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ + var largeArraySize = 30; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = window._; + + /** Used to detect template delimiter values that require a with-statement */ + var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/; + + /** Used to match HTML entities */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/g; + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to insert the data object variable into compiled template source */ + var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + (objectRef.valueOf + '') + .replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') + .replace(/valueOf|for [^\]]+/g, '.+?') + '$' + ); + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 + */ + var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)}/g; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to match HTML characters */ + var reUnescapedHtml = /[&<>"']/g; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowed = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** Native method shortcuts */ + var ceil = Math.ceil, + concat = arrayRef.concat, + floor = Math.floor, + getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectRef.hasOwnProperty, + push = arrayRef.push, + propertyIsEnumerable = objectRef.propertyIsEnumerable, + slice = arrayRef.slice, + toString = objectRef.toString; + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, + nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = window.isFinite, + nativeIsNaN = window.isNaN, + nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeRandom = Math.random; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** + * Detect the JScript [[DontEnum]] bug: + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well. + */ + var hasDontEnumBug; + + /** Detect if own properties are iterated after inherited properties (IE < 9) */ + var iteratesOwnLast; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects + * incorrectly: + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + */ + var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, + arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); + + /** Detect if an `arguments` object's indexes are non-enumerable (IE < 9) */ + var noArgsEnum = true; + + (function() { + var props = []; + function ctor() { this.x = 1; } + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var prop in new ctor) { props.push(prop); } + for (prop in arguments) { noArgsEnum = !prop; } + + hasDontEnumBug = !/valueOf/.test(props); + iteratesOwnLast = props[0] != 'x'; + }(1)); + + /** Detect if an `arguments` object's [[Class]] is unresolvable (Firefox < 4, IE < 9) */ + var noArgsClass = !isArguments(arguments); + + /** Detect if `Array#slice` cannot be used to convert strings to arrays (Opera < 10.52) */ + var noArraySliceOnStrings = slice.call('x')[0] != 'x'; + + /** + * Detect lack of support for accessing string characters by index: + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + */ + var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a node's [[Class]] is unresolvable (IE < 9) + * and that the JS engine won't error when attempting to coerce an object to + * a string without a `toString` property value of `typeof` "function". + */ + try { + var noNodeClass = ({ 'toString': 0 } + '', toString.call(window.document || 0) == objectClass); + } catch(e) { } + + /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ + var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera)); + + /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ + var isKeysFast = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent); + + /** + * Detect if sourceURL syntax is usable without erroring: + * + * The JS engine in Adobe products, like InDesign, will throw a syntax error + * when it encounters a single line comment beginning with the `@` symbol. + * + * The JS engine in Narwhal will generate the function `function anonymous(){//}` + * and throw a syntax error. + * + * Avoid comments beginning `@` symbols in IE because they are part of its + * non-standard conditional compilation support. + * http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx + */ + try { + var useSourceURL = (Function('//@')(), !window.attachEvent); + } catch(e) { } + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[argsClass] = cloneableClasses[funcClass] = false; + cloneableClasses[arrayClass] = cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = cloneableClasses[regexpClass] = + cloneableClasses[stringClass] = true; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The `lodash` function. + * + * @name _ + * @constructor + * @category Chaining + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodash(value) { + // exit early if already wrapped + if (value && value.__wrapped__) { + return value; + } + // allow invoking `lodash` without the `new` operator + if (!(this instanceof lodash)) { + return new lodash(value); + } + this.__wrapped__ = value; + } + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @static + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @static + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @static + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @static + * @memberOf _.templateSettings + * @type String + */ + 'variable': '' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Obect} data The data object used to populate the text. + * @returns {String} Returns the interpolated text. + */ + var iteratorTemplate = template( + // conditional strict mode + '<% if (obj.useStrict) { %>\'use strict\';\n<% } %>' + + + // the `iteratee` may be reassigned by the `top` snippet + 'var index, value, iteratee = <%= firstArg %>, ' + + // assign the `result` variable an initial value + 'result = <%= firstArg %>;\n' + + // exit early if the first argument is falsey + 'if (!<%= firstArg %>) return result;\n' + + // add code before the iteration branches + '<%= top %>;\n' + + + // array-like iteration: + '<% if (arrayLoop) { %>' + + 'var length = iteratee.length; index = -1;\n' + + 'if (typeof length == \'number\') {' + + + // add support for accessing string characters by index if needed + ' <% if (noCharByIndex) { %>\n' + + ' if (isString(iteratee)) {\n' + + ' iteratee = iteratee.split(\'\')\n' + + ' }' + + ' <% } %>\n' + + + // iterate over the array-like value + ' while (++index < length) {\n' + + ' value = iteratee[index];\n' + + ' <%= arrayLoop %>\n' + + ' }\n' + + '}\n' + + 'else {' + + + // object iteration: + // add support for iterating over `arguments` objects if needed + ' <% } else if (noArgsEnum) { %>\n' + + ' var length = iteratee.length; index = -1;\n' + + ' if (length && isArguments(iteratee)) {\n' + + ' while (++index < length) {\n' + + ' value = iteratee[index += \'\'];\n' + + ' <%= objectLoop %>\n' + + ' }\n' + + ' } else {' + + ' <% } %>' + + + // Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + // (if the prototype or a property on the prototype has been set) + // incorrectly sets a function's `prototype` property [[Enumerable]] + // value to `true`. Because of this Lo-Dash standardizes on skipping + // the the `prototype` property of functions regardless of its + // [[Enumerable]] value. + ' <% if (!hasDontEnumBug) { %>\n' + + ' var skipProto = typeof iteratee == \'function\' && \n' + + ' propertyIsEnumerable.call(iteratee, \'prototype\');\n' + + ' <% } %>' + + + // iterate own properties using `Object.keys` if it's fast + ' <% if (isKeysFast && useHas) { %>\n' + + ' var ownIndex = -1,\n' + + ' ownProps = objectTypes[typeof iteratee] ? nativeKeys(iteratee) : [],\n' + + ' length = ownProps.length;\n\n' + + ' while (++ownIndex < length) {\n' + + ' index = ownProps[ownIndex];\n' + + ' <% if (!hasDontEnumBug) { %>if (!(skipProto && index == \'prototype\')) {\n <% } %>' + + ' value = iteratee[index];\n' + + ' <%= objectLoop %>\n' + + ' <% if (!hasDontEnumBug) { %>}\n<% } %>' + + ' }' + + + // else using a for-in loop + ' <% } else { %>\n' + + ' for (index in iteratee) {<%' + + ' if (!hasDontEnumBug || useHas) { %>\n if (<%' + + ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' + + ' if (!hasDontEnumBug && useHas) { %> && <% }' + + ' if (useHas) { %>hasOwnProperty.call(iteratee, index)<% }' + + ' %>) {' + + ' <% } %>\n' + + ' value = iteratee[index];\n' + + ' <%= objectLoop %>;' + + ' <% if (!hasDontEnumBug || useHas) { %>\n }<% } %>\n' + + ' }' + + ' <% } %>' + + + // Because IE < 9 can't set the `[[Enumerable]]` attribute of an + // existing property and the `constructor` property of a prototype + // defaults to non-enumerable, Lo-Dash skips the `constructor` + // property when it infers it's iterating over a `prototype` object. + ' <% if (hasDontEnumBug) { %>\n\n' + + ' var ctor = iteratee.constructor;\n' + + ' <% for (var k = 0; k < 7; k++) { %>\n' + + ' index = \'<%= shadowed[k] %>\';\n' + + ' if (<%' + + ' if (shadowed[k] == \'constructor\') {' + + ' %>!(ctor && ctor.prototype === iteratee) && <%' + + ' } %>hasOwnProperty.call(iteratee, index)) {\n' + + ' value = iteratee[index];\n' + + ' <%= objectLoop %>\n' + + ' }' + + ' <% } %>' + + ' <% } %>' + + ' <% if (arrayLoop || noArgsEnum) { %>\n}<% } %>\n' + + + // add code to the bottom of the iteration function + '<%= bottom %>;\n' + + // finally, return the `result` + 'return result' + ); + + /** + * Reusable iterator options shared by `forEach`, `forIn`, and `forOwn`. + */ + var forEachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': 'callback = createCallback(callback, thisArg)', + 'arrayLoop': 'if (callback(value, index, collection) === false) return result', + 'objectLoop': 'if (callback(value, index, collection) === false) return result' + }; + + /** Reusable iterator options for `defaults`, and `extend` */ + var extendIteratorOptions = { + 'useHas': false, + 'args': 'object', + 'top': + 'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' + + ' if (iteratee = arguments[argsIndex]) {', + 'objectLoop': 'result[index] = value', + 'bottom': ' }\n}' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'arrayLoop': null + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function optimized to search large arrays for a given `value`, + * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @param {Number} [largeSize=30] The length at which an array is considered large. + * @returns {Boolean} Returns `true` if `value` is found, else `false`. + */ + function cachedContains(array, fromIndex, largeSize) { + fromIndex || (fromIndex = 0); + + var length = array.length, + isLarge = (length - fromIndex) >= (largeSize || largeArraySize); + + if (isLarge) { + var cache = {}, + index = fromIndex - 1; + + while (++index < length) { + // manually coerce `value` to a string because `hasOwnProperty`, in some + // older versions of Firefox, coerces objects incorrectly + var key = array[index] + ''; + (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]); + } + } + return function(value) { + if (isLarge) { + var key = value + ''; + return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; + } + return indexOf(array, value, fromIndex) > -1; + } + } + + /** + * Used by `_.max` and `_.min` as the default `callback` when a given + * `collection` is a string value. + * + * @private + * @param {String} value The character to inspect. + * @returns {Number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || a === undefined) { + return 1; + } + if (a < b || b === undefined) { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any `partailArgs` to the arguments passed + * to the bound function. + * + * @private + * @param {Function|String} func The function to bind or the method name. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Array} partialArgs An array of arguments to be partially applied. + * @returns {Function} Returns the new bound function. + */ + function createBound(func, thisArg, partialArgs) { + var isFunc = isFunction(func), + isPartial = !partialArgs, + methodName = func; + + // juggle arguments + if (isPartial) { + partialArgs = thisArg; + } + + function bound() { + // `Function#bind` spec + // http://es5.github.com/#x15.3.4.5 + var args = arguments, + thisBinding = isPartial ? this : thisArg; + + if (!isFunc) { + func = thisArg[methodName]; + } + if (partialArgs.length) { + args = args.length + ? partialArgs.concat(slice.call(args)) + : partialArgs; + } + if (this instanceof bound) { + // get `func` instance if `bound` is invoked in a `new` expression + noop.prototype = func.prototype; + thisBinding = new noop; + + // mimic the constructor's `return` behavior + // http://es5.github.com/#x13.2.2 + var result = func.apply(thisBinding, args); + return isObject(result) + ? result + : thisBinding + } + return func.apply(thisBinding, args); + } + return bound; + } + + /** + * Produces an iteration callback bound to an optional `thisArg`. If `func` is + * a property name, the callback will return the property value for a given element. + * + * @private + * @param {Function|String} [func=identity|property] The function called per + * iteration or property name to query. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Function} Returns a callback function. + */ + function createCallback(func, thisArg) { + if (!func) { + return identity; + } + if (typeof func != 'function') { + return function(object) { + return object[func]; + }; + } + if (thisArg !== undefined) { + return function(value, index, object) { + return func.call(thisArg, value, index, object); + }; + } + return func; + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {Object} [options1, options2, ...] The compile options object(s). + * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. + * args - A string of comma separated arguments the iteration function will accept. + * top - A string of code to execute before the iteration branches. + * arrayLoop - A string of code to execute in the array loop. + * objectLoop - A string of code to execute in the object loop. + * bottom - A string of code to execute after the iteration branches. + * + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + var data = { + 'arrayLoop': '', + 'bottom': '', + 'hasDontEnumBug': hasDontEnumBug, + 'isKeysFast': isKeysFast, + 'objectLoop': '', + 'noArgsEnum': noArgsEnum, + 'noCharByIndex': noCharByIndex, + 'shadowed': shadowed, + 'top': '', + 'useHas': true + }; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + data[key] = object[key]; + } + } + var args = data.args; + data.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'createCallback, hasOwnProperty, isArguments, isString, objectTypes, ' + + 'nativeKeys, propertyIsEnumerable', + 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' + ); + // return the compiled function + return factory( + createCallback, hasOwnProperty, isArguments, isString, objectTypes, + nativeKeys, propertyIsEnumerable + ); + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {String} match The matched character to unescape. + * @returns {String} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return toString.call(value) == argsClass; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (noArgsClass) { + isArguments = function(value) { + return value ? hasOwnProperty.call(value, 'callee') : false; + }; + } + + /** + * Iterates over `object`'s own and inherited enumerable properties, executing + * the `callback` for each property. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, key, object). Callbacks may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Dog(name) { + * this.name = name; + * } + * + * Dog.prototype.bark = function() { + * alert('Woof, woof!'); + * }; + * + * _.forIn(new Dog('Dagny'), function(value, key) { + * alert(key); + * }); + * // => alerts 'name' and 'bark' (order is not guaranteed) + */ + var forIn = createIterator(forEachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * Iterates over `object`'s own enumerable properties, executing the `callback` + * for each property. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by explicitly + * returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * alert(key); + * }); + * // => alerts '0', '1', and 'length' (order is not guaranteed) + */ + var forOwn = createIterator(forEachIteratorOptions, forOwnIteratorOptions); + + /** + * A fallback implementation of `isPlainObject` that checks if a given `value` + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + // avoid non-objects and false positives for `arguments` objects + var result = false; + if (!(value && typeof value == 'object') || isArguments(value)) { + return result; + } + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings. + // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) + var ctor = value.constructor; + if ((!noNodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && + (!isFunction(ctor) || ctor instanceof ctor)) { + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (iteratesOwnLast) { + forIn(value, function(value, key, object) { + result = !hasOwnProperty.call(object, key); + return false; + }); + return result === false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return result === false || hasOwnProperty.call(value, result); + } + return result; + } + + /** + * A fallback implementation of `Object.keys` that produces an array of the + * given object's own enumerable property names. + * + * @private + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + */ + function shimKeys(object) { + var result = []; + forOwn(object, function(value, key) { + result.push(key); + }); + return result; + } + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a clone of `value`. If `deep` is `true`, all nested objects will + * also be cloned otherwise they will be assigned by reference. Functions, DOM + * nodes, `arguments` objects, and objects created by constructors other than + * `Object` are **not** cloned. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to clone. + * @param {Boolean} deep A flag to indicate a deep clone. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `deep`. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate clones with their + * source counterparts. + * @returns {Mixed} Returns the cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.clone({ 'name': 'moe' }); + * // => { 'name': 'moe' } + * + * var shallow = _.clone(stooges); + * shallow[0] === stooges[0]; + * // => true + * + * var deep = _.clone(stooges, true); + * shallow[0] === stooges[0]; + * // => false + */ + function clone(value, deep, guard, stackA, stackB) { + if (value == null) { + return value; + } + if (guard) { + deep = false; + } + // inspect [[Class]] + var isObj = isObject(value); + if (isObj) { + // don't clone `arguments` objects, functions, or non-object Objects + var className = toString.call(value); + if (!cloneableClasses[className] || (noArgsClass && isArguments(value))) { + return value; + } + var isArr = className == arrayClass; + isObj = isArr || (className == objectClass ? isPlainObject(value) : isObj); + } + // shallow clone + if (!isObj || !deep) { + // don't clone functions + return isObj + ? (isArr ? slice.call(value) : extend({}, value)) + : value; + } + + var ctor = value.constructor; + switch (className) { + case boolClass: + case dateClass: + return new ctor(+value); + + case numberClass: + case stringClass: + return new ctor(value); + + case regexpClass: + return ctor(value.source, reFlags.exec(value)); + } + // check for circular references and return corresponding clone + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // init cloned object + var result = isArr ? ctor(value.length) : {}; + + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? forEach : forOwn)(value, function(objValue, key) { + result[key] = clone(objValue, deep, null, stackA, stackB); + }); + + return result; + } + + /** + * Assigns enumerable properties of the default object(s) to the `destination` + * object for all `destination` properties that resolve to `null`/`undefined`. + * Once a property is set, additional defaults of the same property will be + * ignored. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [default1, default2, ...] The default objects. + * @returns {Object} Returns the destination object. + * @example + * + * var iceCream = { 'flavor': 'chocolate' }; + * _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' }); + * // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' } + */ + var defaults = createIterator(extendIteratorOptions, { + 'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop + }); + + /** + * Assigns enumerable properties of the source object(s) to the `destination` + * object. Subsequent sources will overwrite propery assignments of previous + * sources. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @returns {Object} Returns the destination object. + * @example + * + * _.extend({ 'name': 'moe' }, { 'age': 40 }); + * // => { 'name': 'moe', 'age': 40 } + */ + var extend = createIterator(extendIteratorOptions); + + /** + * Creates a sorted array of all enumerable properties, own and inherited, + * of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified object `property` exists and is a direct property, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to check. + * @param {String} property The property to check for. + * @returns {Boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, property) { + return object ? hasOwnProperty.call(object, property) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' }); + * // => { 'Moe': 'first', 'Larry': 'second', 'Curly': 'third' } (order is not guaranteed) + */ + function invert(object) { + var result = {}; + forOwn(object, function(value, key) { + result[value] = key; + }); + return result; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return toString.call(value) == arrayClass; + }; + + /** + * Checks if `value` is a boolean (`true` or `false`) value. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || toString.call(value) == boolClass; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return toString.call(value) == dateClass; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value ? value.nodeType === 1 : false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|String} value The value to inspect. + * @returns {Boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + className == argsClass || (noArgsClass && isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} a The value to compare. + * @param {Mixed} b The other value to compare. + * @param- {Object} [stackA=[]] Internally used track traversed `a` objects. + * @param- {Object} [stackB=[]] Internally used track traversed `b` objects. + * @returns {Boolean} Returns `true` if the values are equvalent, else `false`. + * @example + * + * var moe = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; + * var clone = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; + * + * moe == clone; + * // => false + * + * _.isEqual(moe, clone); + * // => true + */ + function isEqual(a, b, stackA, stackB) { + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + // a strict comparison is necessary because `null == undefined` + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a); + if (className != toString.call(b)) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return a != +a + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.com/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == b + ''; + } + // exit early, in older browsers, if `a` is array-like but not `b` + var isArr = className == arrayClass || className == argsClass; + if (noArgsClass && !isArr && (isArr = isArguments(a)) && !isArguments(b)) { + return false; + } + if (!isArr) { + // unwrap any `lodash` wrapped values + if (a.__wrapped__ || b.__wrapped__) { + return isEqual(a.__wrapped__ || a, b.__wrapped__ || b); + } + // exit for functions and DOM nodes + if (className != objectClass || (noNodeClass && ( + (typeof a.toString != 'function' && typeof (a + '') == 'string') || + (typeof b.toString != 'function' && typeof (b + '') == 'string')))) { + return false; + } + var ctorA = a.constructor, + ctorB = b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && !( + isFunction(ctorA) && ctorA instanceof ctorA && + isFunction(ctorB) && ctorB instanceof ctorB + )) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3) + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + + var index = -1, + result = true, + size = 0; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + // compare lengths to determine if a deep comparison is necessary + size = a.length; + result = size == b.length; + + if (result) { + // deep compare the contents, ignoring non-numeric properties + while (size--) { + if (!(result = isEqual(a[size], b[size], stackA, stackB))) { + break; + } + } + } + return result; + } + // deep compare objects + for (var key in a) { + if (hasOwnProperty.call(a, key)) { + // count the number of properties. + size++; + // deep compare each property value. + if (!(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { + return false; + } + } + } + // ensure both objects have the same number of properties + for (key in b) { + // The JS engine in Adobe products, like InDesign, has a bug that causes + // `!size--` to throw an error so it must be wrapped in parentheses. + // https://github.com/documentcloud/underscore/issues/355 + if (hasOwnProperty.call(b, key) && !(size--)) { + // `size` will be `-1` if `b` has more properties than `a` + return false; + } + } + // handle JScript [[DontEnum]] bug + if (hasDontEnumBug) { + while (++index < 7) { + key = shadowed[index]; + if (hasOwnProperty.call(a, key) && + !(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { + return false; + } + } + } + return true; + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite`, which will return true for + * booleans and empty strings. See http://es5.github.com/#x15.1.2.5. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a finite number, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.com/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return value ? objectTypes[typeof value] : false; + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN`, which will return true for + * `undefined` and other values. See http://es5.github.com/#x15.1.2.4. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return toString.call(value) == numberClass && value != +value + } + + /** + * Checks if `value` is `null`. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return toString.call(value) == numberClass; + } + + /** + * Checks if a given `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Stooge(name, age) { + * this.name = name; + * this.age = age; + * } + * + * _.isPlainObject(new Stooge('moe', 40)); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'name': 'moe', 'age': 40 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && typeof value == 'object')) { + return false; + } + var valueOf = value.valueOf, + objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value)) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/moe/); + * // => true + */ + function isRegExp(value) { + return toString.call(value) == regexpClass; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('moe'); + * // => true + */ + function isString(value) { + return toString.call(value) == stringClass; + } + + /** + * Checks if `value` is `undefined`. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Creates an array composed of the own enumerable property names of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (order is not guaranteed) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + // avoid iterating over the `prototype` property + return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype') + ? shimKeys(object) + : (isObject(object) ? nativeKeys(object) : []); + }; + + /** + * Merges enumerable properties of the source object(s) into the `destination` + * object. Subsequent sources will overwrite propery assignments of previous + * sources. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param- {Object} [indicator] Internally used to indicate that the `stack` + * argument is an array of traversed objects instead of another source object. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate values with their + * source counterparts. + * @returns {Object} Returns the destination object. + * @example + * + * var stooges = [ + * { 'name': 'moe' }, + * { 'name': 'larry' } + * ]; + * + * var ages = [ + * { 'age': 40 }, + * { 'age': 50 } + * ]; + * + * _.merge(stooges, ages); + * // => [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] + */ + function merge(object, source, indicator) { + var args = arguments, + index = 0, + length = 2, + stackA = args[3], + stackB = args[4]; + + if (indicator !== objectRef) { + stackA = []; + stackB = []; + length = args.length; + } + while (++index < length) { + forOwn(args[index], function(source, key) { + var found, isArr, value; + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + found = stackA[stackLength] == source; + if (found) { + break; + } + } + if (found) { + object[key] = stackB[stackLength]; + } + else { + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value = (value = object[key], isArr) + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}) + ); + // recursively merge objects and arrays (susceptible to call stack limits) + object[key] = merge(value, source, objectRef, stackA, stackB); + } + } else if (source != null) { + object[key] = source; + } + }); + } + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If `callback` is passed, it will be executed for each property + * in the `object`, omitting the properties `callback` returns truthy for. The + * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit + * or the function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid'); + * // => { 'name': 'moe', 'age': 40 } + * + * _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { + * return key.charAt(0) == '_'; + * }); + * // => { 'name': 'moe' } + */ + function omit(object, callback, thisArg) { + var isFunc = typeof callback == 'function', + result = {}; + + if (isFunc) { + callback = createCallback(callback, thisArg); + } else { + var props = concat.apply(arrayRef, arguments); + } + forIn(object, function(value, key, object) { + if (isFunc + ? !callback(value, key, object) + : indexOf(props, key, 1) < 0 + ) { + result[key] = value; + } + }); + return result; + } + + /** + * Creates a two dimensional array of the given object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 }); + * // => [['moe', 30], ['larry', 40], ['curly', 50]] (order is not guaranteed) + */ + function pairs(object) { + var result = []; + forOwn(object, function(value, key) { + result.push([key, value]); + }); + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If `callback` is passed, it will be executed for each property + * in the `object`, picking the properties `callback` returns truthy for. The + * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|String} callback|[prop1, prop2, ...] The properties to pick + * or the function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age'); + * // => { 'name': 'moe', 'age': 40 } + * + * _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'moe' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = 0, + props = concat.apply(arrayRef, arguments), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = createCallback(callback, thisArg); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] + */ + function values(object) { + var result = []; + forOwn(object, function(value) { + result.push(value); + }); + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if a given `target` element is present in a `collection` using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Mixed} target The value to check for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); + * // => true + * + * _.contains('curly', 'ur'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + length = collection ? collection.length : 0; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (typeof length == 'number') { + return (isString(collection) + ? collection.indexOf(target, fromIndex) + : indexOf(collection, target, fromIndex) + ) > -1; + } + return some(collection, function(value) { + return ++index >= fromIndex && value === target; + }); + } + + /** + * Creates an object composed of keys returned from running each element of + * `collection` through a `callback`. The corresponding value of each key is + * the number of times the key was returned by `callback`. The `callback` is + * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * The `callback` argument may also be the name of a property to count by (e.g. 'length'). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} callback|property The function called per iteration + * or property name to count by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + function countBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection); + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + return result; + } + + /** + * Checks if the `callback` returns a truthy value for **all** elements of a + * `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if all elements pass the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + forEach(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * the `callback` returns truthy for. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * Examines each element in a `collection`, returning the first one the `callback` + * returns truthy for. The function returns as soon as it finds an acceptable + * element, and does not iterate over the entire `collection`. The `callback` is + * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias detect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the element that passed the callback check, + * else `undefined`. + * @example + * + * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => 2 + */ + function find(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over a `collection`, executing the `callback` for each element in + * the `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). Callbacks may exit iteration early + * by explicitly returning `false`. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|String} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(alert).join(','); + * // => alerts each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); + * // => alerts each number (order is not guaranteed) + */ + var forEach = createIterator(forEachIteratorOptions); + + /** + * Creates an object composed of keys returned from running each element of + * `collection` through a `callback`. The corresponding value of each key is an + * array of elements passed to `callback` that returned the key. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * The `callback` argument may also be the name of a property to group by (e.g. 'length'). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} callback|property The function called per iteration + * or property name to group by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + function groupBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection); + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + return result; + } + + /** + * Invokes the method named by `methodName` on each element in the `collection`, + * returning an array of the results of each invoked method. Additional arguments + * will be passed to each invoked method. If `methodName` is a function it will + * be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice.call(arguments, 2), + isFunc = typeof methodName == 'function', + result = []; + + forEach(collection, function(value) { + result.push((isFunc ? methodName : value[methodName]).apply(value, args)); + }); + return result; + } + + /** + * Creates an array of values by running each element in the `collection` + * through a `callback`. The `callback` is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (order is not guaranteed) + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + forEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index, collection). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the maximum value. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.max(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'curly', 'age': 60 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + index = -1, + length = collection ? collection.length : 0, + result = computed; + + if (callback || !isArray(collection)) { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } else { + while (++index < length) { + if (collection[index] > result) { + result = collection[index]; + } + } + } + return result; + } + + /** + * Retrieves the minimum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to `thisArg` + * and invoked with three arguments; (value, index, collection). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the minimum value. + * @example + * + * _.min([10, 5, 100, 2, 1000]); + * // => 2 + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + index = -1, + length = collection ? collection.length : 0, + result = computed; + + if (callback || !isArray(collection)) { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } else { + while (++index < length) { + if (collection[index] < result) { + result = collection[index]; + } + } + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in + * the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {String} property The property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.pluck(stooges, 'name'); + * // => ['moe', 'larry', 'curly'] + */ + function pluck(collection, property) { + var result = []; + forEach(collection, function(value) { + result.push(value[property]); + }); + return result; + } + + /** + * Boils down a `collection` to a single value. The initial state of the + * reduction is `accumulator` and each successive step of it should be returned + * by the `callback`. The `callback` is bound to `thisArg` and invoked with 4 + * arguments; for arrays they are (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; }); + * // => 6 + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + return accumulator; + } + + /** + * The right-associative version of `_.reduce`. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var iteratee = collection, + length = collection ? collection.length : 0, + noaccum = arguments.length < 3; + + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (noCharByIndex && isString(collection)) { + iteratee = collection.split(''); + } + forEach(collection, function(value, index, collection) { + index = props ? props[--length] : --length; + accumulator = noaccum + ? (noaccum = false, iteratee[index]) + : callback.call(thisArg, accumulator, iteratee[index], index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter`, this method returns the values of a + * `collection` that `callback` does **not** return truthy for. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that did **not** pass the + * callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + */ + function reject(collection, callback, thisArg) { + callback = createCallback(callback, thisArg); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Creates an array of shuffled `array` values, using a version of the + * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + result = Array(collection ? collection.length : 0); + + forEach(collection, function(value) { + var rand = floor(nativeRandom() * (++index + 1)); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to inspect. + * @returns {Number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('curly'); + * // => 5 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the `callback` returns a truthy value for **any** element of a + * `collection`. The function returns as soon as it finds passing value, and + * does not iterate over the entire `collection`. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if any element passes the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false]); + * // => true + */ + function some(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (result = callback(collection[index], index, collection)) { + break; + } + } + } else { + forEach(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array, stable sorted in ascending order by the results of + * running each element of `collection` through a `callback`. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * The `callback` argument may also be the name of a property to sort by (e.g. 'length'). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} callback|property The function called per iteration + * or property name to sort by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * _.sortBy(['larry', 'brendan', 'moe'], 'length'); + * // => ['moe', 'larry', 'brendan'] + */ + function sortBy(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + result.push({ + 'criteria': callback(value, index, collection), + 'index': index, + 'value': value + }); + }); + + var length = result.length; + result.sort(compareAscending); + while (length--) { + result[length] = result[length].value; + } + return result; + } + + /** + * Converts the `collection`, to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return (noArraySliceOnStrings ? isString(collection) : typeof collection == 'string') + ? collection.split('') + : slice.call(collection); + } + return values(collection); + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * that contain the given `properties`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Object} properties The object of property values to filter by. + * @returns {Array} Returns a new array of elements that contain the given `properties`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.where(stooges, { 'age': 40 }); + * // => [{ 'name': 'moe', 'age': 40 }] + */ + function where(collection, properties) { + var props = []; + forIn(properties, function(value, prop) { + props.push(prop); + }); + return filter(collection, function(object) { + var length = props.length; + while (length--) { + var result = object[props[length]] === properties[props[length]]; + if (!result) { + break; + } + } + return !!result; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values of `array` removed. The values + * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array of `array` elements not present in the other arrays + * using strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {Array} [array1, array2, ...] Arrays to check. + * @returns {Array} Returns a new array of `array` elements not present in the + * other arrays. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + var index = -1, + length = array ? array.length : 0, + flattened = concat.apply(arrayRef, arguments), + contains = cachedContains(flattened, length), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Gets the first element of the `array`. Pass `n` to return the first `n` + * elements of the `array`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n] The number of elements to return. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Mixed} Returns the first element or an array of the first `n` + * elements of `array`. + * @example + * + * _.first([5, 4, 3, 2, 1]); + * // => 5 + */ + function first(array, n, guard) { + if (array) { + return (n == null || guard) ? array[0] : slice.call(array, 0, n); + } + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `shallow` is + * truthy, `array` will only be flattened a single level. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @param {Boolean} shallow A flag to indicate only flattening a single level. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + */ + function flatten(array, shallow) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + // recursively flatten arrays (susceptible to call stack limits) + if (isArray(value)) { + push.apply(result, shallow ? value : flatten(value)); + } else { + result.push(value); + } + } + return result; + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the `array` is already + * sorted, passing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to + * perform a binary search on a sorted `array`. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + var index = -1, + length = array ? array.length : 0; + + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; + } else if (fromIndex) { + index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Gets all but the last element of `array`. Pass `n` to exclude the last `n` + * elements from the result. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n=1] The number of elements to exclude. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Array} Returns all but the last element or `n` elements of `array`. + * @example + * + * _.initial([3, 2, 1]); + * // => [3, 2] + */ + function initial(array, n, guard) { + return array + ? slice.call(array, 0, -((n == null || guard) ? 1 : n)) + : []; + } + + /** + * Computes the intersection of all the passed-in arrays using strict equality + * for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique elements, in order, that are + * present in **all** of the arrays. + * @example + * + * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2] + */ + function intersection(array) { + var args = arguments, + argsLength = args.length, + cache = {}, + result = []; + + forEach(array, function(value) { + if (indexOf(result, value) < 0) { + var length = argsLength; + while (--length) { + if (!(cache[length] || (cache[length] = cachedContains(args[length])))(value)) { + return; + } + } + result.push(value); + } + }); + return result; + } + + /** + * Gets the last element of the `array`. Pass `n` to return the last `n` + * elements of the `array`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n] The number of elements to return. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Mixed} Returns the last element or an array of the last `n` + * elements of `array`. + * @example + * + * _.last([3, 2, 1]); + * // => 1 + */ + function last(array, n, guard) { + if (array) { + var length = array.length; + return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length); + } + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=array.length-1] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Pass either + * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or + * two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.object(['moe', 'larry', 'curly'], [30, 40, 50]); + * // => { 'moe': 30, 'larry': 40, 'curly': 50 } + */ + function object(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else { + result[key[0]] = key[1]; + } + } + return result; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `stop`. This method is a port of Python's + * `range()` function. See http://docs.python.org/library/functions.html#range. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Number} [start=0] The start of the range. + * @param {Number} end The end of the range. + * @param {Number} [step=1] The value to increment or descrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(10); + * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + * + * _.range(1, 11); + * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * + * _.range(0, 30, 5); + * // => [0, 5, 10, 15, 20, 25] + * + * _.range(0, -10, -1); + * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = +step || 1; + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s + var index = -1, + length = nativeMax(0, ceil((end - start) / step)), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * The opposite of `_.initial`, this method gets all but the first value of + * `array`. Pass `n` to exclude the first `n` values from the result. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n=1] The number of elements to exclude. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Array} Returns all but the first value or `n` values of `array`. + * @example + * + * _.rest([3, 2, 1]); + * // => [2, 1] + */ + function rest(array, n, guard) { + return array + ? slice.call(array, (n == null || guard) ? 1 : n) + : []; + } + + /** + * Uses a binary search to determine the smallest index at which the `value` + * should be inserted into `array` in order to maintain the sort order of the + * sorted `array`. If `callback` is passed, it will be executed for `value` and + * each element in `array` to compute their sort ranking. The `callback` is + * bound to `thisArg` and invoked with one argument; (value). The `callback` + * argument may also be the name of a property to order by. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to iterate over. + * @param {Mixed} value The value to evaluate. + * @param {Function|String} [callback=identity|property] The function called + * per iteration or property name to order by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Number} Returns the index at which the value should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better engine inlining + callback = callback ? createCallback(callback, thisArg) : identity; + value = callback(value); + while (low < high) { + var mid = (low + high) >>> 1; + callback(array[mid]) < value + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Computes the union of the passed-in arrays using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique values, in order, that are + * present in one or more of the arrays. + * @example + * + * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2, 3, 101, 10] + */ + function union() { + return uniq(concat.apply(arrayRef, arguments)); + } + + /** + * Creates a duplicate-value-free version of the `array` using strict equality + * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` + * for `isSorted` will run a faster algorithm. If `callback` is passed, each + * element of `array` is passed through a callback` before uniqueness is computed. + * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2, 3] + */ + function uniq(array, isSorted, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = [], + seen = result; + + // juggle arguments + if (typeof isSorted == 'function') { + thisArg = callback; + callback = isSorted; + isSorted = false; + } + // init value cache for large arrays + var isLarge = !isSorted && length > 74; + if (isLarge) { + var cache = {}; + } + if (callback) { + seen = []; + callback = createCallback(callback, thisArg); + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isLarge) { + // manually coerce `computed` to a string because `hasOwnProperty`, in + // some older versions of Firefox, coerces objects incorrectly + seen = hasOwnProperty.call(cache, computed + '') ? cache[computed] : (cache[computed] = []); + } + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * Creates an array with all occurrences of the passed values removed using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {Mixed} [value1, value2, ...] Values to remove. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + var index = -1, + length = array ? array.length : 0, + contains = cachedContains(arguments, 1, 20), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Groups the elements of each array at their corresponding indexes. Useful for + * separate data sources that are coordinated through matching array indexes. + * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix + * in a similar fashion. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); + * // => [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] + */ + function zip(array) { + var index = -1, + length = array ? max(pluck(arguments, 'length')) : 0, + result = Array(length); + + while (++index < length) { + result[index] = pluck(arguments, index); + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that is restricted to executing `func` only after it is + * called `n` times. The `func` is executed with the `this` binding of the + * created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Number} n The number of times the function must be called before + * it is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var renderNotes = _.after(notes.length, render); + * _.forEach(notes, function(note) { + * note.asyncSave({ 'success': renderNotes }); + * }); + * // `renderNotes` is run once, after all notes have saved + */ + function after(n, func) { + if (n < 1) { + return func(); + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * passed to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'moe' }, 'hi'); + * func(); + * // => 'hi moe' + */ + function bind(func, thisArg) { + // use `Function#bind` if it exists and is fast + // (in V8 `Function#bind` is slower except when partially applied) + return isBindFast || (nativeBind && arguments.length > 2) + ? nativeBind.call.apply(nativeBind, arguments) + : createBound(func, thisArg, slice.call(arguments, 2)); + } + + /** + * Binds methods on `object` to `object`, overwriting the existing method. + * If no method names are provided, all the function properties of `object` + * will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {String} [methodName1, methodName2, ...] Method names on the object to bind. + * @returns {Object} Returns `object`. + * @example + * + * var buttonView = { + * 'label': 'lodash', + * 'onClick': function() { alert('clicked: ' + this.label); } + * }; + * + * _.bindAll(buttonView); + * jQuery('#lodash_button').on('click', buttonView.onClick); + * // => When the button is clicked, `this.label` will have the correct value + */ + function bindAll(object) { + var funcs = arguments, + index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = bind(object[key], object); + } + return object; + } + + /** + * Creates a function that is the composition of the passed functions, + * where each function consumes the return value of the function that follows. + * In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} [func1, func2, ...] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var greet = function(name) { return 'hi: ' + name; }; + * var exclaim = function(statement) { return statement + '!'; }; + * var welcome = _.compose(exclaim, greet); + * welcome('moe'); + * // => 'hi: moe!' + */ + function compose() { + var funcs = arguments; + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. Pass + * `true` for `immediate` to cause debounce to invoke `func` on the leading, + * instead of the trailing, edge of the `wait` timeout. Subsequent calls to + * the debounced function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {Number} wait The number of milliseconds to delay. + * @param {Boolean} immediate A flag to indicate execution is on the leading + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * var lazyLayout = _.debounce(calculateLayout, 300); + * jQuery(window).on('resize', lazyLayout); + */ + function debounce(func, wait, immediate) { + var args, + result, + thisArg, + timeoutId; + + function delayed() { + timeoutId = null; + if (!immediate) { + result = func.apply(thisArg, args); + } + } + return function() { + var isImmediate = immediate && !timeoutId; + args = arguments; + thisArg = this; + + clearTimeout(timeoutId); + timeoutId = setTimeout(delayed, wait); + + if (isImmediate) { + result = func.apply(thisArg, args); + } + return result; + }; + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {Number} wait The number of milliseconds to delay execution. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * var log = _.bind(console.log, console); + * _.delay(log, 1000, 'logged later'); + * // => 'logged later' (Appears after one second.) + */ + function delay(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * _.defer(function() { alert('deferred'); }); + * // returns from the function before `alert` is called + */ + function defer(func) { + var args = slice.call(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + + /** + * Creates a function that, when called, invokes `object[methodName]` and + * prepends any additional `lateBind` arguments to those passed to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {String} methodName The method name. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'moe', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.lateBind(object, 'greet', 'hi'); + * func(); + * // => 'hi moe' + * + * object.greet = function(greeting) { + * return greeting + ', ' + this.name + '!'; + * }; + * + * func(); + * // => 'hi, moe!' + */ + function lateBind(object, methodName) { + return createBound(methodName, object, slice.call(arguments, 2)); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * passed, it will be used to determine the cache key for storing the result + * based on the arguments passed to the memoized function. By default, the first + * argument passed to the memoized function is used as the cache key. The `func` + * is executed with the `this` binding of the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + */ + function memoize(func, resolver) { + var cache = {}; + return function() { + var key = resolver ? resolver.apply(this, arguments) : arguments[0]; + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + }; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // Application is only created once. + */ + function once(func) { + var result, + ran = false; + + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those passed to the new function. This + * method is similar to `bind`, except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ': ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('moe'); + * // => 'hi: moe' + */ + function partial(func) { + return createBound(func, slice.call(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` + * function at most once per every `wait` milliseconds. If the throttled + * function is invoked more than once during the `wait` timeout, `func` will + * also be called on the trailing edge of the timeout. Subsequent calls to the + * throttled function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {Number} wait The number of milliseconds to throttle executions to. + * @returns {Function} Returns the new throttled function. + * @example + * + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + */ + function throttle(func, wait) { + var args, + result, + thisArg, + timeoutId, + lastCalled = 0; + + function trailingCall() { + lastCalled = new Date; + timeoutId = null; + result = func.apply(thisArg, args); + } + return function() { + var now = new Date, + remaining = wait - (now - lastCalled); + + args = arguments; + thisArg = this; + + if (remaining <= 0) { + clearTimeout(timeoutId); + lastCalled = now; + result = func.apply(thisArg, args); + } + else if (!timeoutId) { + timeoutId = setTimeout(trailingCall, remaining); + } + return result; + }; + } + + /** + * Creates a function that passes `value` to the `wrapper` function as its + * first argument. Additional arguments passed to the function are appended + * to those passed to the `wrapper` function. The `wrapper` is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Mixed} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var hello = function(name) { return 'hello ' + name; }; + * hello = _.wrap(hello, function(func) { + * return 'before, ' + func('moe') + ', after'; + * }); + * hello(); + * // => 'before, hello moe, after' + */ + function wrap(value, wrapper) { + return function() { + var args = [value]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} string The string to escape. + * @returns {String} Returns the escaped string. + * @example + * + * _.escape('Moe, Larry & Curly'); + * // => "Moe, Larry & Curly" + */ + function escape(string) { + return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This function returns the first argument passed to it. + * + * Note: It is used throughout Lo-Dash as a default callback. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Mixed} value Any value. + * @returns {Mixed} Returns `value`. + * @example + * + * var moe = { 'name': 'moe' }; + * moe === _.identity(moe); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds functions properties of `object` to the `lodash` function and chainable + * wrapper. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object of function properties to add to `lodash`. + * @example + * + * _.mixin({ + * 'capitalize': function(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * }); + * + * _.capitalize('larry'); + * // => 'Larry' + * + * _('curly').capitalize(); + * // => 'Curly' + */ + function mixin(object) { + forEach(functions(object), function(methodName) { + var func = lodash[methodName] = object[methodName]; + + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + + var result = func.apply(lodash, args); + if (this.__chain__) { + result = new lodash(result); + result.__chain__ = true; + } + return result; + }; + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + window._ = oldDash; + return this; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is passed, a number between `0` and the given number will be returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Number} [min=0] The minimum possible value. + * @param {Number} [max=1] The maximum possible value. + * @returns {Number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => a number between 1 and 5 + * + * _.random(5); + * // => also a number between 1 and 5 + */ + function random(min, max) { + if (min == null && max == null) { + max = 1; + } + min = +min || 0; + if (max == null) { + max = min; + min = 0; + } + return min + floor(nativeRandom() * ((+max || 0) - min + 1)); + } + + /** + * Resolves the value of `property` on `object`. If `property` is a function + * it will be invoked and its result returned, else the property value is + * returned. If `object` is falsey, then `null` is returned. + * + * @deprecated + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {String} property The property to get the value of. + * @returns {Mixed} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, property) { + // based on Backbone's private `getValue` function + // https://github.com/documentcloud/backbone/blob/0.9.2/backbone.js#L1419-1424 + var value = object ? object[property] : null; + return isFunction(value) ? object[property]() : value; + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` + * build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. + * See http://developer.chrome.com/trunk/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} text The template text. + * @param {Obect} data The data object used to populate the text. + * @param {Object} options The options object. + * escape - The "escape" delimiter regexp. + * evaluate - The "evaluate" delimiter regexp. + * interpolate - The "interpolate" delimiter regexp. + * sourceURL - The sourceURL of the template's compiled source. + * variable - The data object variable name. + * + * @returns {Function|String} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'moe' }); + * // => 'hello moe' + * + * var list = '<% _.forEach(people, function(name) { %>
    • <%= name %>
    • <% }); %>'; + * _.template(list, { 'people': ['moe', 'larry', 'curly'] }); + * // => '
    • moe
    • larry
    • curly
    • ' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '\n```\n\nUsing [npm](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n```\n\n**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Resolved Underscore.js issues\n\n * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L545-551)]\n * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L558-582)]\n * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L140-146)]\n * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L747-752)]\n * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L828-840)]\n * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L921-923)]\n * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L1337-1340)]\n\n## Release Notes\n\n### v0.9.2\n\n * Added `fromIndex` argument to `_.contains`\n * Added `moduleId` build option\n * Added Closure Compiler *“simple”* optimizations to the build process\n * Added support for strings in `_.max` and `_.min`\n * Added support for ES6 template delimiters to `_.template`\n * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs\n * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq`\n\nThe full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", + "readmeFilename": "README.md", + "_id": "lodash@0.9.2", + "_from": "lodash@0.9.2" +} diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/.travis.yml b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/.travis.yml new file mode 100644 index 0000000..ab27b29 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/.travis.yml @@ -0,0 +1,8 @@ +language: ruby +rvm: + - 1.9.3 + +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 2 \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile new file mode 100644 index 0000000..f024827 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile @@ -0,0 +1,5 @@ +source :rubygems + +gem 'serve' +gem 'uglifier' +gem 'rake' \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile.lock new file mode 100644 index 0000000..a6bb1e7 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile.lock @@ -0,0 +1,34 @@ +GEM + remote: http://rubygems.org/ + specs: + activesupport (3.2.3) + i18n (~> 0.6) + multi_json (~> 1.0) + execjs (1.3.0) + multi_json (~> 1.0) + i18n (0.6.0) + multi_json (1.2.0) + rack (1.4.1) + rack-test (0.6.1) + rack (>= 1.0) + rake (0.9.2.2) + serve (1.5.1) + activesupport (~> 3.0) + i18n + rack (~> 1.2) + rack-test (~> 0.5) + tilt (~> 1.3) + tzinfo + tilt (1.3.3) + tzinfo (0.3.33) + uglifier (1.2.4) + execjs (>= 0.3.0) + multi_json (>= 1.0.2) + +PLATFORMS + ruby + +DEPENDENCIES + rake + serve + uglifier diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/README.markdown b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/README.markdown new file mode 100644 index 0000000..d2244b5 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/README.markdown @@ -0,0 +1,668 @@ +# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # + + + +Javascript lacks complete string manipulation operations. +This an attempt to fill that gap. List of build-in methods can be found +for example from [Dive Into JavaScript][d]. + +[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object + + +As name states this an extension for [Underscore.js][u], but it can be used +independently from **_s**-global variable. But with Underscore.js you can +use Object-Oriented style and chaining: + +[u]: http://documentcloud.github.com/underscore/ + +```javascript +_(" epeli ").chain().trim().capitalize().value() +=> "Epeli" +``` + +## Download ## + + * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* + * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* + + +## Node.js installation ## + +**npm package** + + npm install underscore.string + +**Standalone usage**: + +```javascript +var _s = require('underscore.string'); +``` + +**Integrate with Underscore.js**: + +```javascript +var _ = require('underscore'); + +// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) +_.str = require('underscore.string'); + +// Mix in non-conflict functions to Underscore namespace if you want +_.mixin(_.str.exports()); + +// All functions, include conflict, will be available through _.str object +_.str.include('Underscore.string', 'string'); // => true +``` + +## String Functions ## + +For availability of functions in this way you need to mix in Underscore.string functions: + +```javascript +_.mixin(_.string.exports()); +``` + +otherwise functions from examples will be available through _.string or _.str objects: + +```javascript +_.str.capitalize('epeli') +=> "Epeli" +``` + +**capitalize** _.capitalize(string) + +Converts first letter of the string to uppercase. + +```javascript +_.capitalize("foo Bar") +=> "Foo Bar" +``` + +**chop** _.chop(string, step) + +```javascript +_.chop('whitespace', 3) +=> ['whi','tes','pac','e'] +``` + +**clean** _.clean(str) + +Compress some whitespaces to one. + +```javascript +_.clean(" foo bar ") +=> 'foo bar' +``` + +**chars** _.chars(str) + +```javascript +_.chars('Hello') +=> ['H','e','l','l','o'] +``` + +**includes** _.includes(string, substring) + +Tests if string contains a substring. + +```javascript +_.includes("foobar", "ob") +=> true +``` + +**include** available only through _.str object, because Underscore has function with the same name. + +```javascript +_.str.include("foobar", "ob") +=> true +``` + +**includes** function was removed + +But you can create it in this way, for compatibility with previous versions: + +```javascript +_.includes = _.str.include +``` + +**count** _.count(string, substring) + +```javascript +_('Hello world').count('l') +=> 3 +``` + +**escapeHTML** _.escapeHTML(string) + +Converts HTML special characters to their entity equivalents. + +```javascript +_('
      Blah blah blah
      ').escapeHTML(); +=> '<div>Blah blah blah</div>' +``` + +**unescapeHTML** _.unescapeHTML(string) + +Converts entity characters to HTML equivalents. + +```javascript +_('<div>Blah blah blah</div>').unescapeHTML(); +=> '
      Blah blah blah
      ' +``` + +**insert** _.insert(string, index, substing) + +```javascript +_('Hello ').insert(6, 'world') +=> 'Hello world' +``` + +**isBlank** _.isBlank(string) + +```javascript +_('').isBlank(); // => true +_('\n').isBlank(); // => true +_(' ').isBlank(); // => true +_('a').isBlank(); // => false +``` + +**join** _.join(separator, *strings) + +Joins strings together with given separator + +```javascript +_.join(" ", "foo", "bar") +=> "foo bar" +``` + +**lines** _.lines(str) + +```javascript +_.lines("Hello\nWorld") +=> ["Hello", "World"] +``` + +**reverse** available only through _.str object, because Underscore has function with the same name. + +Return reversed string: + +```javascript +_.str.reverse("foobar") +=> 'raboof' +``` + +**splice** _.splice(string, index, howmany, substring) + +Like a array splice. + +```javascript +_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') +=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' +``` + +**startsWith** _.startsWith(string, starts) + +This method checks whether string starts with starts. + +```javascript +_("image.gif").startsWith("image") +=> true +``` + +**endsWith** _.endsWith(string, ends) + +This method checks whether string ends with ends. + +```javascript +_("image.gif").endsWith("gif") +=> true +``` + +**succ** _.succ(str) + +Returns the successor to str. + +```javascript +_('a').succ() +=> 'b' + +_('A').succ() +=> 'B' +``` + +**supplant** + +Supplant function was removed, use Underscore.js [template function][p]. + +[p]: http://documentcloud.github.com/underscore/#template + +**strip** alias for *trim* + +**lstrip** alias for *ltrim* + +**rstrip** alias for *rtrim* + +**titleize** _.titleize(string) + +```javascript +_('my name is epeli').titleize() +=> 'My Name Is Epeli' +``` + +**camelize** _.camelize(string) + +Converts underscored or dasherized string to a camelized one + +```javascript +_('-moz-transform').camelize() +=> 'MozTransform' +``` + +**classify** _.classify(string) + +Converts string to camelized class name + +```javascript +_('some_class_name').classify() +=> 'SomeClassName' +``` + +**underscored** _.underscored(string) + +Converts a camelized or dasherized string into an underscored one + +```javascript +_('MozTransform').underscored() +=> 'moz_transform' +``` + +**dasherize** _.dasherize(string) + +Converts a underscored or camelized string into an dasherized one + +```javascript +_('MozTransform').dasherize() +=> '-moz-transform' +``` + +**humanize** _.humanize(string) + +Converts an underscored, camelized, or dasherized string into a humanized one. +Also removes beginning and ending whitespace, and removes the postfix '_id'. + +```javascript +_(' capitalize dash-CamelCase_underscore trim ').humanize() +=> 'Capitalize dash camel case underscore trim' +``` + +**trim** _.trim(string, [characters]) + +trims defined characters from begining and ending of the string. +Defaults to whitespace characters. + +```javascript +_.trim(" foobar ") +=> "foobar" + +_.trim("_-foobar-_", "_-") +=> "foobar" +``` + + +**ltrim** _.ltrim(string, [characters]) + +Left trim. Similar to trim, but only for left side. + + +**rtrim** _.rtrim(string, [characters]) + +Right trim. Similar to trim, but only for right side. + +**truncate** _.truncate(string, length, truncateString) + +```javascript +_('Hello world').truncate(5) +=> 'Hello...' + +_('Hello').truncate(10) +=> 'Hello' +``` + +**prune** _.prune(string, length, pruneString) + +Elegant version of truncate. +Makes sure the pruned string does not exceed the original length. +Avoid half-chopped words when truncating. + +```javascript +_('Hello, world').prune(5) +=> 'Hello...' + +_('Hello, world').prune(8) +=> 'Hello...' + +_('Hello, world').prune(5, ' (read a lot more)') +=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) + +_('Hello, cruel world').prune(15) +=> 'Hello, cruel...' + +_('Hello').prune(10) +=> 'Hello' +``` + +**words** _.words(str, delimiter=" ") + +Split string by delimiter (String or RegExp), ' ' by default. + +```javascript +_.words("I love you") +=> ["I","love","you"] + +_.words("I_love_you", "_") +=> ["I","love","you"] + +_.words("I-love-you", /-/) +=> ["I","love","you"] +``` + +**sprintf** _.sprintf(string format, *arguments) + +C like string formatting. +Credits goes to [Alexandru Marasteanu][o]. +For more detailed documentation, see the [original page][o]. + +[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript + +```javascript +_.sprintf("%.1f", 1.17) +"1.2" +``` + +**pad** _.pad(str, length, [padStr, type]) + +pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary. + +```javascript +_.pad("1", 8) +-> " 1"; + +_.pad("1", 8, '0') +-> "00000001"; + +_.pad("1", 8, '0', 'right') +-> "10000000"; + +_.pad("1", 8, '0', 'both') +-> "00001000"; + +_.pad("1", 8, 'bleepblorp', 'both') +-> "bbbb1bbb"; +``` + +**lpad** _.lpad(str, length, [padStr]) + +left-pad a string. Alias for `pad(str, length, padStr, 'left')` + +```javascript +_.lpad("1", 8, '0') +-> "00000001"; +``` + +**rpad** _.rpad(str, length, [padStr]) + +right-pad a string. Alias for `pad(str, length, padStr, 'right')` + +```javascript +_.rpad("1", 8, '0') +-> "10000000"; +``` + +**lrpad** _.lrpad(str, length, [padStr]) + +left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` + +```javascript +_.lrpad("1", 8, '0') +-> "00001000"; +``` + +**center** alias for **lrpad** + +**ljust** alias for *rpad* + +**rjust** alias for *lpad* + +**toNumber** _.toNumber(string, [decimals]) + +Parse string to number. Returns NaN if string can't be parsed to number. + +```javascript +_('2.556').toNumber() +=> 3 + +_('2.556').toNumber(1) +=> 2.6 +``` + +**strRight** _.strRight(string, pattern) + +Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strRight('_') +=> "is_a_test_string"; +``` + +**strRightBack** _.strRightBack(string, pattern) + +Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strRightBack('_') +=> "string"; +``` + +**strLeft** _.strLeft(string, pattern) + +Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strLeft('_') +=> "This"; +``` + +**strLeftBack** _.strLeftBack(string, pattern) + +Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. + +```javascript +_('This_is_a_test_string').strLeftBack('_') +=> "This_is_a_test"; +``` + +**stripTags** + +Removes all html tags from string. + +```javascript +_('a link').stripTags() +=> 'a link' + +_('a link').stripTags() +=> 'a linkalert("hello world!")' +``` + +**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) + +Join an array into a human readable sentence. + +```javascript +_.toSentence(['jQuery', 'Mootools', 'Prototype']) +=> 'jQuery, Mootools and Prototype'; + +_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') +=> 'jQuery, Mootools unt Prototype'; +``` + +**repeat** _.repeat(string, count, [separator]) + +Repeats a string count times. + +```javascript +_.repeat("foo", 3) +=> 'foofoofoo'; + +_.repeat("foo", 3, "bar") +=> 'foobarfoobarfoo' +``` + +**slugify** _.slugify(string) + +Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. + +```javascript +_.slugify("Un éléphant à l'orée du bois") +=> 'un-elephant-a-loree-du-bois'; +``` + +***Caution: this function is charset dependent*** + +## Roadmap ## + +Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. + +## Changelog ## + +### 2.0.0 ### + +* Added prune, humanize functions +* Added _.string (_.str) namespace for Underscore.string library +* Removed includes function + +#### Problems + +We lose two things for `include` and `reverse` methods from `_.string`: + +* Calls like `_('foobar').include('bar')` aren't available; +* Chaining isn't available too. + +But if you need this functionality you can create aliases for conflict functions which will be convenient for you: + +```javascript +_.mixin({ + includeString: _.str.include, + reverseString: _.str.reverse +}) + +// Now wrapper calls and chaining are available. +_('foobar').chain().reverseString().includeString('rab').value() +``` + +#### Standalone Usage + +If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias +But of course you can just reassign `_` variable with `_.string` + +```javascript +_ = _.string +``` +### 2.2.0 ### + +* Capitalize method behavior changed +* Various perfomance tweaks + +### 2.1.1### + +* Fixed words method bug +* Added classify method + +### 2.1.0 ### + +* AMD support +* Added toSentence method +* Added slugify method +* Lots of speed optimizations + +### 2.0.0 ### + +For upgrading to this version you need to mix in Underscore.string library to Underscore object: + +```javascript +_.mixin(_.string.exports()); +``` + +and all non-conflict Underscore.string functions will be available through Underscore object. +Also function `includes` has been removed, you should replace this function by `_.str.include` +or create alias `_.includes = _.str.include` and all your code will work fine. + +### 1.1.6 ### + +* Fixed reverse and truncate +* Added isBlank, stripTags, inlude(alias for includes) +* Added uglifier compression + +### 1.1.5 ### + +* Added strRight, strRightBack, strLeft, strLeftBack + +### 1.1.4 ### + +* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust +* Integration with Underscore 1.1.6 + +### 1.1.3 ### + +* Added methods: underscored, camelize, dasherize +* Support newer version of npm + +### 1.1.2 ### + +* Created functions: lines, chars, words functions + +### 1.0.2 ### + +* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) +* Removed 'reverse' function, because this function override underscore.js 'reverse' + +## Contribute ## + +* Fork & pull request. Don't forget about tests. +* If you planning add some feature please create issue before. + +Otherwise changes will be rejected. + +## Contributors list ## + +* Esa-Matti Suuronen (), +* Edward Tsech , +* Sasha Koss (), +* Vladimir Dronnikov , +* Pete Kruckenberg (), +* Paul Chavard (), +* Ed Finkler () +* Pavel Pravosud +* Anton Lindqvist () + +## Licence ## + +The MIT License + +Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Rakefile b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Rakefile new file mode 100644 index 0000000..baa164c --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Rakefile @@ -0,0 +1,28 @@ +# encoding: utf-8 +task default: :test + +desc 'Use UglifyJS to compress Underscore.string' +task :build do + require 'uglifier' + source = File.read('lib/underscore.string.js') + compressed = Uglifier.compile(source, copyright: false) + File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } + compression_rate = compressed.length.to_f/source.length + puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" +end + +desc 'Run tests' +task :test do + pid = spawn('bundle exec serve', err: '/dev/null') + sleep 2 + + puts "Running underscore.string test suite." + result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"} + + puts "Running Underscore test suite." + result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"} + + Process.kill 'INT', pid + + exit(result1 && result2 ? 0 : 1) +end \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/dist/underscore.string.min.js new file mode 100644 index 0000000..cd436e1 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/dist/underscore.string.min.js @@ -0,0 +1 @@ +(function(a){"use strict";var b=String.prototype.trim,c=String.prototype.trimRight,d=String.prototype.trimLeft,e=function(a){return a*1||0},f=function(a,b,c){a+="",b=~~b;for(var d=[];b>0;d[--b]=a);return d.join(c==null?"":c)},g=function(a){return Array.prototype.slice.call(a)},h=function(a){return a!=null?"["+m.escapeRegExp(""+a)+"]":"\\s"},i={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},j={};for(var k in i)j[i[k]]=k;var l=function(){function a(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}var b=f,c=function(){return c.cache.hasOwnProperty(arguments[0])||(c.cache[arguments[0]]=c.parse(arguments[0])),c.format.call(null,c.cache[arguments[0]],arguments)};return c.format=function(c,d){var e=1,f=c.length,g="",h,i=[],j,k,m,n,o,p;for(j=0;j=0?"+"+h:h,o=m[4]?m[4]=="0"?"0":m[4].charAt(1):" ",p=m[6]-String(h).length,n=m[6]?b(o,p):"",i.push(m[5]?h+n:n+h)}}return i.join("")},c.cache={},c.parse=function(a){var b=a,c=[],d=[],e=0;while(b){if((c=/^[^\x25]+/.exec(b))!==null)d.push(c[0]);else if((c=/^\x25{2}/.exec(b))!==null)d.push("%");else{if((c=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b))===null)throw new Error("[_.sprintf] huh?");if(c[2]){e|=1;var f=[],g=c[2],h=[];if((h=/^([a-z_][a-z_\d]*)/i.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1]);while((g=g.substring(h[0].length))!=="")if((h=/^\.([a-z_][a-z_\d]*)/i.exec(g))!==null)f.push(h[1]);else{if((h=/^\[(\d+)\]/.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1])}c[2]=f}else e|=2;if(e===3)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");d.push(c)}b=b.substring(c[0].length)}return d},c}(),m={VERSION:"2.1.1",isBlank:function(a){return/^\s*$/.test(a)},stripTags:function(a){return(""+a).replace(/<\/?[^>]+>/g,"")},capitalize:function(a){return a+="",a.charAt(0).toUpperCase()+a.substring(1)},chop:function(a,b){a+="",b=~~b||a.length;var c=[];for(var d=0;d"']/g,function(a){return"&"+j[a]+";"})},unescapeHTML:function(a){return(""+a).replace(/\&([^;]+);/g,function(a,b){var c;return b in i?i[b]:(c=b.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(c[1],16)):(c=b.match(/^#(\d+)$/))?String.fromCharCode(~~c[1]):a})},escapeRegExp:function(a){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},insert:function(a,b,c){var d=m.chars(a);return d.splice(~~b,0,""+c),d.join("")},include:function(a,b){return!!~(""+a).indexOf(b)},join:function(){var a=g(arguments);return a.join(a.shift())},lines:function(a){return(""+a).split("\n")},reverse:function(a){return m.chars(a).reverse().join("")},splice:function(a,b,c,d){var e=m.chars(a);return e.splice(~~b,~~c,d),e.join("")},startsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(0,b.length)===b},endsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(a.length-b.length)===b},succ:function(a){a+="";var b=m.chars(a);return b.splice(a.length-1,1,String.fromCharCode(a.charCodeAt(a.length-1)+1)),b.join("")},titleize:function(a){return(""+a).replace(/\b./g,function(a){return a.toUpperCase()})},camelize:function(a){return m.trim(a).replace(/[-_\s]+(.)?/g,function(a,b){return b&&b.toUpperCase()})},underscored:function(a){return m.trim(a).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(a){return m.trim(a).replace(/[_\s]+/g,"-").replace(/([A-Z])/g,"-$1").replace(/-+/g,"-").toLowerCase()},classify:function(a){return a+="",m.titleize(a.replace(/_/g," ")).replace(/\s/g,"")},humanize:function(a){return m.capitalize(this.underscored(a).replace(/_id$/,"").replace(/_/g," "))},trim:function(a,c){return a+="",!c&&b?b.call(a):(c=h(c),a.replace(new RegExp("^"+c+"+|"+c+"+$","g"),""))},ltrim:function(a,b){return a+="",!b&&d?d.call(a):(b=h(b),a.replace(new RegExp("^"+b+"+"),""))},rtrim:function(a,b){return a+="",!b&&c?c.call(a):(b=h(b),a.replace(new RegExp(b+"+$"),""))},truncate:function(a,b,c){return a+="",c=c||"...",b=~~b,a.length>b?a.slice(0,b)+c:a},prune:function(a,b,c){a+="",b=~~b,c=c!=null?""+c:"...";var d,e,f=a.replace(/\W/g,function(a){return a.toUpperCase()!==a.toLowerCase()?"A":" "});return e=f.charAt(b),d=f.slice(0,b),e&&e.match(/\S/)&&(d=d.replace(/\s\S+$/,"")),d=m.rtrim(d),(d+c).length>a.length?a:a.substring(0,d.length)+c},words:function(a,b){return m.trim(a,b).split(b||/\s+/)},pad:function(a,b,c,d){a+="";var e=0;b=~~b,c?c.length>1&&(c=c.charAt(0)):c=" ";switch(d){case"right":return e=b-a.length,a+f(c,e);case"both":return e=b-a.length,f(c,Math.ceil(e/2))+a+f(c,Math.floor(e/2));default:return e=b-a.length,f(c,e)+a}},lpad:function(a,b,c){return m.pad(a,b,c)},rpad:function(a,b,c){return m.pad(a,b,c,"right")},lrpad:function(a,b,c){return m.pad(a,b,c,"both")},sprintf:l,vsprintf:function(a,b){return b.unshift(a),l.apply(null,b)},toNumber:function(a,b){a+="";var c=e(e(a).toFixed(~~b));return c===0&&!a.match(/^0+$/)?Number.NaN:c},strRight:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strRightBack:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.lastIndexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strLeft:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(0,c):a},strLeftBack:function(a,b){a+="",b=b!=null?""+b:b;var c=a.lastIndexOf(b);return~c?a.slice(0,c):a},toSentence:function(a,b,c){b||(b=", "),c||(c=" and ");var d=a.length,e="";for(var f=0;f +// Underscore.strings is freely distributable under the terms of the MIT license. +// Documentation: https://github.com/epeli/underscore.string +// Some code is borrowed from MooTools and Alexandru Marasteanu. + +// Version 2.2.0rc + +(function(root){ + 'use strict'; + + // Defining helper functions. + + var nativeTrim = String.prototype.trim; + var nativeTrimRight = String.prototype.trimRight; + var nativeTrimLeft = String.prototype.trimLeft; + + var parseNumber = function(source) { return source * 1 || 0; }; + + var strRepeat = function(str, qty, separator){ + // ~~var — is the fastest available way to convert anything to Integer in javascript. + // We'll use it extensively in this lib. + str += ''; qty = ~~qty; + for (var repeat = []; qty > 0; repeat[--qty] = str) {} + return repeat.join(separator == null ? '' : separator); + }; + + var slice = function(a){ + return Array.prototype.slice.call(a); + }; + + var defaultToWhiteSpace = function(characters){ + if (characters != null) { + return '[' + _s.escapeRegExp(''+characters) + ']'; + } + return '\\s'; + }; + + var escapeChars = { + lt: '<', + gt: '>', + quot: '"', + apos: "'", + amp: '&' + }; + + var reversedEscapeChars = {}; + for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; } + + // sprintf() for JavaScript 0.7-beta1 + // http://www.diveintojavascript.com/projects/javascript-sprintf + // + // Copyright (c) Alexandru Marasteanu + // All rights reserved. + + var sprintf = (function() { + function get_type(variable) { + return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); + } + + var str_repeat = strRepeat; + + var str_format = function() { + if (!str_format.cache.hasOwnProperty(arguments[0])) { + str_format.cache[arguments[0]] = str_format.parse(arguments[0]); + } + return str_format.format.call(null, str_format.cache[arguments[0]], arguments); + }; + + str_format.format = function(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length; + for (i = 0; i < tree_length; i++) { + node_type = get_type(parse_tree[i]); + if (node_type === 'string') { + output.push(parse_tree[i]); + } + else if (node_type === 'array') { + match = parse_tree[i]; // convenience purposes only + if (match[2]) { // keyword argument + arg = argv[cursor]; + for (k = 0; k < match[2].length; k++) { + if (!arg.hasOwnProperty(match[2][k])) { + throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); + } + arg = arg[match[2][k]]; + } + } else if (match[1]) { // positional argument (explicit) + arg = argv[match[1]]; + } + else { // positional argument (implicit) + arg = argv[cursor++]; + } + + if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { + throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); + } + switch (match[8]) { + case 'b': arg = arg.toString(2); break; + case 'c': arg = String.fromCharCode(arg); break; + case 'd': arg = parseInt(arg, 10); break; + case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break; + case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; + case 'o': arg = arg.toString(8); break; + case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break; + case 'u': arg = Math.abs(arg); break; + case 'x': arg = arg.toString(16); break; + case 'X': arg = arg.toString(16).toUpperCase(); break; + } + arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg); + pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' '; + pad_length = match[6] - String(arg).length; + pad = match[6] ? str_repeat(pad_character, pad_length) : ''; + output.push(match[5] ? arg + pad : pad + arg); + } + } + return output.join(''); + }; + + str_format.cache = {}; + + str_format.parse = function(fmt) { + var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; + while (_fmt) { + if ((match = /^[^\x25]+/.exec(_fmt)) !== null) { + parse_tree.push(match[0]); + } + else if ((match = /^\x25{2}/.exec(_fmt)) !== null) { + parse_tree.push('%'); + } + else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1; + var field_list = [], replacement_field = match[2], field_match = []; + if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { + field_list.push(field_match[1]); + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { + if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { + field_list.push(field_match[1]); + } + else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) { + field_list.push(field_match[1]); + } + else { + throw new Error('[_.sprintf] huh?'); + } + } + } + else { + throw new Error('[_.sprintf] huh?'); + } + match[2] = field_list; + } + else { + arg_names |= 2; + } + if (arg_names === 3) { + throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); + } + parse_tree.push(match); + } + else { + throw new Error('[_.sprintf] huh?'); + } + _fmt = _fmt.substring(match[0].length); + } + return parse_tree; + }; + + return str_format; + })(); + + + + // Defining underscore.string + + var _s = { + + VERSION: '2.2.0rc', + + isBlank: function(str){ + return (/^\s*$/).test(str); + }, + + stripTags: function(str){ + return (''+str).replace(/<\/?[^>]+>/g, ''); + }, + + capitalize : function(str) { + str += ''; + return str.charAt(0).toUpperCase() + str.substring(1); + }, + + chop: function(str, step){ + str = str+''; + step = ~~step || str.length; + var arr = []; + for (var i = 0; i < str.length; i += step) + arr.push(str.slice(i,i + step)); + return arr; + }, + + clean: function(str){ + return _s.strip(str).replace(/\s+/g, ' '); + }, + + count: function(str, substr){ + str += ''; substr += ''; + return str.split(substr).length - 1; + }, + + chars: function(str) { + return (''+str).split(''); + }, + + escapeHTML: function(str) { + return (''+str).replace(/[&<>"']/g, function(match){ return '&' + reversedEscapeChars[match] + ';'; }); + }, + + unescapeHTML: function(str) { + return (''+str).replace(/\&([^;]+);/g, function(entity, entityCode){ + var match; + + if (entityCode in escapeChars) { + return escapeChars[entityCode]; + } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { + return String.fromCharCode(parseInt(match[1], 16)); + } else if (match = entityCode.match(/^#(\d+)$/)) { + return String.fromCharCode(~~match[1]); + } else { + return entity; + } + }); + }, + + escapeRegExp: function(str){ + // From MooTools core 1.2.4 + return str.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); + }, + + insert: function(str, i, substr){ + var arr = _s.chars(str); + arr.splice(~~i, 0, ''+substr); + return arr.join(''); + }, + + include: function(str, needle){ + return !!~(''+str).indexOf(needle); + }, + + join: function() { + var args = slice(arguments); + return args.join(args.shift()); + }, + + lines: function(str) { + return (''+str).split("\n"); + }, + + reverse: function(str){ + return _s.chars(str).reverse().join(''); + }, + + splice: function(str, i, howmany, substr){ + var arr = _s.chars(str); + arr.splice(~~i, ~~howmany, substr); + return arr.join(''); + }, + + startsWith: function(str, starts){ + str += ''; starts += ''; + return str.length >= starts.length && str.substring(0, starts.length) === starts; + }, + + endsWith: function(str, ends){ + str += ''; ends += ''; + return str.length >= ends.length && str.substring(str.length - ends.length) === ends; + }, + + succ: function(str){ + str += ''; + var arr = _s.chars(str); + arr.splice(str.length-1, 1, String.fromCharCode(str.charCodeAt(str.length-1) + 1)); + return arr.join(''); + }, + + titleize: function(str){ + return (''+str).replace(/\b./g, function(ch){ return ch.toUpperCase(); }); + }, + + camelize: function(str){ + return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, chr){ + return chr && chr.toUpperCase(); + }); + }, + + underscored: function(str){ + return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); + }, + + dasherize: function(str){ + return _s.trim(str).replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase(); + }, + + classify: function(str){ + str += ''; + return _s.titleize(str.replace(/_/g, ' ')).replace(/\s/g, '') + }, + + humanize: function(str){ + return _s.capitalize(this.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); + }, + + trim: function(str, characters){ + str += ''; + if (!characters && nativeTrim) { return nativeTrim.call(str); } + characters = defaultToWhiteSpace(characters); + return str.replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); + }, + + ltrim: function(str, characters){ + str+=''; + if (!characters && nativeTrimLeft) { + return nativeTrimLeft.call(str); + } + characters = defaultToWhiteSpace(characters); + return str.replace(new RegExp('^' + characters + '+'), ''); + }, + + rtrim: function(str, characters){ + str+=''; + if (!characters && nativeTrimRight) { + return nativeTrimRight.call(str); + } + characters = defaultToWhiteSpace(characters); + return str.replace(new RegExp(characters + '+$'), ''); + }, + + truncate: function(str, length, truncateStr){ + str += ''; truncateStr = truncateStr || '...'; + length = ~~length; + return str.length > length ? str.slice(0, length) + truncateStr : str; + }, + + /** + * _s.prune: a more elegant version of truncate + * prune extra chars, never leaving a half-chopped word. + * @author github.com/sergiokas + */ + prune: function(str, length, pruneStr){ + str += ''; length = ~~length; + pruneStr = pruneStr != null ? ''+pruneStr : '...'; + + var pruned, borderChar, template = str.replace(/\W/g, function(ch){ + return (ch.toUpperCase() !== ch.toLowerCase()) ? 'A' : ' '; + }); + + borderChar = template.charAt(length); + + pruned = template.slice(0, length); + + // Check if we're in the middle of a word + if (borderChar && borderChar.match(/\S/)) + pruned = pruned.replace(/\s\S+$/, ''); + + pruned = _s.rtrim(pruned); + + return (pruned+pruneStr).length > str.length ? str : str.substring(0, pruned.length)+pruneStr; + }, + + words: function(str, delimiter) { + return _s.trim(str, delimiter).split(delimiter || /\s+/); + }, + + pad: function(str, length, padStr, type) { + str += ''; + + var padlen = 0; + + length = ~~length; + + if (!padStr) { + padStr = ' '; + } else if (padStr.length > 1) { + padStr = padStr.charAt(0); + } + + switch(type) { + case 'right': + padlen = (length - str.length); + return str + strRepeat(padStr, padlen); + case 'both': + padlen = (length - str.length); + return strRepeat(padStr, Math.ceil(padlen/2)) + + str + + strRepeat(padStr, Math.floor(padlen/2)); + default: // 'left' + padlen = (length - str.length); + return strRepeat(padStr, padlen) + str; + } + }, + + lpad: function(str, length, padStr) { + return _s.pad(str, length, padStr); + }, + + rpad: function(str, length, padStr) { + return _s.pad(str, length, padStr, 'right'); + }, + + lrpad: function(str, length, padStr) { + return _s.pad(str, length, padStr, 'both'); + }, + + sprintf: sprintf, + + vsprintf: function(fmt, argv){ + argv.unshift(fmt); + return sprintf.apply(null, argv); + }, + + toNumber: function(str, decimals) { + str += ''; + var num = parseNumber(parseNumber(str).toFixed(~~decimals)); + return num === 0 && !str.match(/^0+$/) ? Number.NaN : num; + }, + + strRight: function(str, sep){ + str += ''; sep = sep != null ? ''+sep : sep; + var pos = !sep ? -1 : str.indexOf(sep); + return ~pos ? str.slice(pos+sep.length, str.length) : str; + }, + + strRightBack: function(str, sep){ + str += ''; sep = sep != null ? ''+sep : sep; + var pos = !sep ? -1 : str.lastIndexOf(sep); + return ~pos ? str.slice(pos+sep.length, str.length) : str; + }, + + strLeft: function(str, sep){ + str += ''; sep = sep != null ? ''+sep : sep; + var pos = !sep ? -1 : str.indexOf(sep); + return ~pos ? str.slice(0, pos) : str; + }, + + strLeftBack: function(str, sep){ + str += ''; sep = sep != null ? ''+sep : sep; + var pos = str.lastIndexOf(sep); + return ~pos ? str.slice(0, pos) : str; + }, + + toSentence: function(array, separator, lastSeparator) { + separator || (separator = ', '); + lastSeparator || (lastSeparator = ' and '); + var length = array.length, str = ''; + + for (var i = 0; i < length; i++) { + str += array[i]; + if (i === (length - 2)) { str += lastSeparator; } + else if (i < (length - 1)) { str += separator; } + } + + return str; + }, + + slugify: function(str) { + var from = "ąàáäâãćęèéëêìíïîłńòóöôõùúüûñçżź", + to = "aaaaaaceeeeeiiiilnooooouuuunczz", + regex = new RegExp(defaultToWhiteSpace(from), 'g'); + + str = (''+str).toLowerCase(); + + str = str.replace(regex, function(ch){ + var index = from.indexOf(ch); + return to.charAt(index) || '-'; + }); + + return _s.trim(str.replace(/[^\w\s-]/g, '').replace(/[-\s]+/g, '-'), '-'); + }, + + exports: function() { + var result = {}; + + for (var prop in this) { + if (!this.hasOwnProperty(prop) || ~_s.words('include contains reverse').indexOf(prop)) continue; + result[prop] = this[prop]; + } + + return result; + }, + + repeat: strRepeat + }; + + // Aliases + + _s.strip = _s.trim; + _s.lstrip = _s.ltrim; + _s.rstrip = _s.rtrim; + _s.center = _s.lrpad; + _s.rjust = _s.lpad; + _s.ljust = _s.rpad; + _s.contains = _s.include; + + // CommonJS module is defined + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + // Export module + module.exports = _s; + } + exports._s = _s; + + } else if (typeof define === 'function' && define.amd) { + // Register as a named module with AMD. + define('underscore.string', function() { + return _s; + }); + + } else { + // Integrate with Underscore.js if defined + // or create our own underscore object. + root._ = root._ || {}; + root._.string = root._.str = _s; + } + +}(this || window)); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/package.json new file mode 100644 index 0000000..c52dddd --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/package.json @@ -0,0 +1,72 @@ +{ + "name": "underscore.string", + "version": "2.2.1", + "description": "String manipulation extensions for Underscore.js javascript library.", + "homepage": "http://epeli.github.com/underscore.string/", + "contributors": [ + { + "name": "Esa-Matti Suuronen", + "email": "esa-matti@suuronen.org", + "url": "http://esa-matti.suuronen.org/" + }, + { + "name": "Edward Tsech", + "email": "edtsech@gmail.com" + }, + { + "name": "Sasha Koss", + "email": "kossnocorp@gmail.com", + "url": "http://koss.nocorp.me/" + }, + { + "name": "Vladimir Dronnikov", + "email": "dronnikov@gmail.com" + }, + { + "name": "Pete Kruckenberg", + "email": "https://github.com/kruckenb", + "url": "" + }, + { + "name": "Paul Chavard", + "email": "paul@chavard.net", + "url": "" + }, + { + "name": "Ed Finkler", + "email": "coj@funkatron.com", + "url": "" + }, + { + "name": "Pavel Pravosud", + "email": "rwz@duckroll.ru" + } + ], + "keywords": [ + "underscore", + "string" + ], + "main": "./lib/underscore.string", + "directories": { + "lib": "./lib" + }, + "engines": { + "node": "*" + }, + "repository": { + "type": "git", + "url": "https://github.com/epeli/underscore.string.git" + }, + "bugs": { + "url": "https://github.com/epeli/underscore.string/issues" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
      Blah blah blah
      ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
      Blah blah blah
      '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=\" \")\n\nSplit string by delimiter (String or RegExp), ' ' by default.\n\n```javascript\n_.words(\"I love you\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n## Changelog ##\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n\n* Esa-Matti Suuronen (),\n* Edward Tsech ,\n* Sasha Koss (),\n* Vladimir Dronnikov ,\n* Pete Kruckenberg (),\n* Paul Chavard (),\n* Ed Finkler ()\n* Pavel Pravosud \n* Anton Lindqvist ()\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", + "readmeFilename": "README.markdown", + "_id": "underscore.string@2.2.1", + "_from": "underscore.string@2.2.1" +} diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/run-qunit.js new file mode 100644 index 0000000..326658e --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/run-qunit.js @@ -0,0 +1,44 @@ +function waitFor(test, complete, timeout) { + var result, start = new Date().getTime() + setInterval(function interval() { + if ((new Date().getTime() - start < timeout) && !result) { + result = test() + } else { + if (!result) { + phantom.exit(1) + } else { + complete() + clearInterval(interval) + } + } + }, 100) +} + + +var page = new WebPage() + +page.onConsoleMessage = function(msg) { + console.log(msg) +} + +page.open(phantom.args[0], function(status) { + waitFor(function() { + return page.evaluate(function(){ + var el = document.getElementById('qunit-testresult') + return el && el.innerText.match('completed') + }) + }, function() { + var failures = page.evaluate(function() { + var el = document.getElementById('qunit-testresult'), + fails = document.getElementsByClassName('fail') + + for (var i = 0; i < fails.length; i++) + console.log(fails[i].innerText) + + console.log(el.innerText) + + return parseInt(el.getElementsByClassName('failed')[0].innerHTML) + }) + phantom.exit(failures > 0 ? 1 : 0) + }, 10000) +}) \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/speed.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/speed.js new file mode 100644 index 0000000..4346414 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/speed.js @@ -0,0 +1,138 @@ +(function() { + + JSLitmus.test('trimNoNative', function() { + return _.trim(" foobar ", " "); + }); + + JSLitmus.test('trim', function() { + return _.trim(" foobar "); + }); + + JSLitmus.test('trim object-oriented', function() { + return _(" foobar ").trim(); + }); + + JSLitmus.test('trim jQuery', function() { + return jQuery.trim(" foobar "); + }); + + JSLitmus.test('ltrimp', function() { + return _.ltrim(" foobar ", " "); + }); + + JSLitmus.test('rtrimp', function() { + return _.rtrim(" foobar ", " "); + }); + + JSLitmus.test('startsWith', function() { + return _.startsWith("foobar", "foo"); + }); + + JSLitmus.test('endsWith', function() { + return _.endsWith("foobar", "xx"); + }); + + JSLitmus.test('chop', function(){ + return _('whitespace').chop(2); + }); + + JSLitmus.test('count', function(){ + return _('Hello worls').count('l'); + }); + + JSLitmus.test('insert', function() { + return _('Hello ').insert(6, 'world'); + }); + + JSLitmus.test('splice', function() { + return _('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'); + }); + + JSLitmus.test('succ', function(){ + var let = 'a', alphabet = []; + + for (var i=0; i < 26; i++) { + alphabet.push(let); + let = _(let).succ(); + } + + return alphabet; + }); + + JSLitmus.test('titleize', function(){ + return _('the titleize string method').titleize(); + }); + + JSLitmus.test('truncate', function(){ + return _('Hello world').truncate(5); + }); + + JSLitmus.test('prune', function(){ + return _('Hello world').prune(5); + }); + + JSLitmus.test('isBlank', function(){ + return _('').isBlank(); + }); + + JSLitmus.test('escapeHTML', function(){ + _('
      Blah blah blah
      ').escapeHTML(); + }); + + JSLitmus.test('unescapeHTML', function(){ + _('<div>Blah blah blah</div>').unescapeHTML(); + }); + + JSLitmus.test('reverse', function(){ + _('Hello World').reverse(); + }); + + JSLitmus.test('pad default', function(){ + _('foo').pad(12); + }); + + JSLitmus.test('pad hash left', function(){ + _('foo').pad(12, '#'); + }); + + JSLitmus.test('pad hash right', function(){ + _('foo').pad(12, '#', 'right'); + }); + + JSLitmus.test('pad hash both', function(){ + _('foo').pad(12, '#', 'both'); + }); + + JSLitmus.test('pad hash both longPad', function(){ + _('foo').pad(12, 'f00f00f00', 'both'); + }); + + JSLitmus.test('toNumber', function(){ + _('10.232323').toNumber(2); + }); + + JSLitmus.test('strRight', function(){ + _('aaa_bbb_ccc').strRight('_'); + }); + + JSLitmus.test('strRightBack', function(){ + _('aaa_bbb_ccc').strRightBack('_'); + }); + + JSLitmus.test('strLeft', function(){ + _('aaa_bbb_ccc').strLeft('_'); + }); + + JSLitmus.test('strLeftBack', function(){ + _('aaa_bbb_ccc').strLeftBack('_'); + }); + + JSLitmus.test('join', function(){ + _('separator').join(1, 2, 3, 4, 5, 6, 7, 8, 'foo', 'bar', 'lol', 'wut'); + }); + + JSLitmus.test('slugify', function(){ + _("Un éléphant à l'orée du bois").slugify(); + }); + +})(); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/strings.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/strings.js new file mode 100644 index 0000000..f700abf --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/strings.js @@ -0,0 +1,438 @@ +$(document).ready(function() { + + // Include Underscore.string methods to Underscore namespace + _.mixin(_.str.exports()); + + module("String extensions"); + + test("Strings: trim", function() { + equals(_.trim(123), "123", "Non string"); + equals(_(" foo").trim(), "foo"); + equals(_("foo ").trim(), "foo"); + equals(_(" foo ").trim(), "foo"); + equals(_(" foo ").trim(), "foo"); + equals(_(" foo ", " ").trim(), "foo", "Manually set whitespace"); + + equals(_("ffoo").trim("f"), "oo"); + equals(_("ooff").trim("f"), "oo"); + equals(_("ffooff").trim("f"), "oo"); + + + equals(_("_-foobar-_").trim("_-"), "foobar"); + + equals(_("http://foo/").trim("/"), "http://foo"); + equals(_("c:\\").trim('\\'), "c:"); + + equals(_(123).trim(), '123'); + equals(_(123).trim(3), '12'); + }); + + test("Strings: ltrim", function() { + equals(_(" foo").ltrim(), "foo"); + equals(_(" foo").ltrim(), "foo"); + equals(_("foo ").ltrim(), "foo "); + equals(_(" foo ").ltrim(), "foo "); + + + equals(_("ffoo").ltrim("f"), "oo"); + equals(_("ooff").ltrim("f"), "ooff"); + equals(_("ffooff").ltrim("f"), "ooff"); + + equals(_("_-foobar-_").ltrim("_-"), "foobar-_"); + + equals(_(123).ltrim(1), '23'); + }); + + test("Strings: rtrim", function() { + equals(_("http://foo/").rtrim("/"), "http://foo", 'clean trailing slash'); + equals(_(" foo").rtrim(), " foo"); + equals(_("foo ").rtrim(), "foo"); + equals(_("foo ").rtrim(), "foo"); + equals(_("foo bar ").rtrim(), "foo bar"); + equals(_(" foo ").rtrim(), " foo"); + + equals(_("ffoo").rtrim("f"), "ffoo"); + equals(_("ooff").rtrim("f"), "oo"); + equals(_("ffooff").rtrim("f"), "ffoo"); + + equals(_("_-foobar-_").rtrim("_-"), "_-foobar"); + + equals(_(123).rtrim(3), '12'); + }); + + test("Strings: capitalize", function() { + equals(_("fabio").capitalize(), "Fabio", 'First letter is upper case'); + equals(_.capitalize("fabio"), "Fabio", 'First letter is upper case'); + equals(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); + equals(_(123).capitalize(), "123", "Non string"); + }); + + test("Strings: join", function() { + equals(_.join("", "foo", "bar"), "foobar", 'basic join'); + equals(_.join("", 1, "foo", 2), "1foo2", 'join numbers and strings'); + equals(_.join(" ","foo", "bar"), "foo bar", 'join with spaces'); + equals(_.join("1", "2", "2"), "212", 'join number strings'); + equals(_.join(1, 2, 2), "212", 'join numbers'); + equals(_(" ").join("foo", "bar"), "foo bar", 'join object oriented'); + }); + + test("Strings: reverse", function() { + equals(_.str.reverse("foo"), "oof" ); + equals(_.str.reverse("foobar"), "raboof" ); + equals(_.str.reverse("foo bar"), "rab oof" ); + equals(_.str.reverse("saippuakauppias"), "saippuakauppias" ); + equals(_.str.reverse(123), "321", "Non string"); + equals(_.str.reverse(123.45), "54.321", "Non string"); + }); + + test("Strings: clean", function() { + equals(_(" foo bar ").clean(), "foo bar"); + equals(_(123).clean(), "123"); + }); + + test("Strings: sprintf", function() { + // Should be very tested function already. Thanks to + // http://www.diveintojavascript.com/projects/sprintf-for-javascript + equals(_.sprintf("Hello %s", "me"), "Hello me", 'basic'); + equals(_("Hello %s").sprintf("me"), "Hello me", 'object'); + equals(_("hello %s").chain().sprintf("me").capitalize().value(), "Hello me", 'Chaining works'); + equals(_.sprintf("%.1f", 1.22222), "1.2", 'round'); + equals(_.sprintf("%.1f", 1.17), "1.2", 'round 2'); + equals(_.sprintf("%(id)d - %(name)s", {id: 824, name: "Hello World"}), "824 - Hello World", 'Named replacements work'); + equals(_.sprintf("%(args[0].id)d - %(args[1].name)s", {args: [{id: 824}, {name: "Hello World"}]}), "824 - Hello World", 'Named replacements with arrays work'); + }); + + + test("Strings: vsprintf", function() { + equals(_.vsprintf("Hello %s", ["me"]), "Hello me", 'basic'); + equals(_("Hello %s").vsprintf(["me"]), "Hello me", 'object'); + equals(_("hello %s").chain().vsprintf(["me"]).capitalize().value(), "Hello me", 'Chaining works'); + equals(_.vsprintf("%.1f", [1.22222]), "1.2", 'round'); + equals(_.vsprintf("%.1f", [1.17]), "1.2", 'round 2'); + equals(_.vsprintf("%(id)d - %(name)s", [{id: 824, name: "Hello World"}]), "824 - Hello World", 'Named replacement works'); + equals(_.vsprintf("%(args[0].id)d - %(args[1].name)s", [{args: [{id: 824}, {name: "Hello World"}]}]), "824 - Hello World", 'Named replacement with arrays works'); + }); + + test("Strings: startsWith", function() { + ok(_("foobar").startsWith("foo"), 'foobar starts with foo'); + ok(!_("oobar").startsWith("foo"), 'oobar does not start with foo'); + ok(_(12345).startsWith(123), '12345 starts with 123'); + ok(!_(2345).startsWith(123), '2345 does not start with 123'); + }); + + test("Strings: endsWith", function() { + ok(_("foobar").endsWith("bar"), 'foobar ends with bar'); + ok(_.endsWith("foobar", "bar"), 'foobar ends with bar'); + ok(_.endsWith("00018-0000062.Plone.sdh264.1a7264e6912a91aa4a81b64dc5517df7b8875994.mp4", "mp4"), 'endsWith .mp4'); + ok(!_("fooba").endsWith("bar"), 'fooba does not end with bar'); + ok(_.endsWith(12345, 45), '12345 ends with 45'); + ok(!_.endsWith(12345, 6), '12345 does not end with 6'); + }); + + test("Strings: include", function() { + ok(_.str.include("foobar", "bar"), 'foobar includes bar'); + ok(!_.str.include("foobar", "buzz"), 'foobar does not includes buzz'); + ok(_.str.include(12345, 34), '12345 includes 34'); + ok(!_.str.contains(12345, 6), '12345 does not includes 6'); + }); + + test('String: chop', function(){ + ok(_('whitespace').chop(2).length === 5, "output ['wh','it','es','pa','ce']"); + ok(_('whitespace').chop(3).length === 4, "output ['whi','tes','pac','e']"); + ok(_('whitespace').chop()[0].length === 10, "output ['whitespace']"); + ok(_(12345).chop(1).length === 5, "output ['1','2','3','4','5']"); + }); + + test('String: clean', function(){ + equals(_.clean(' foo bar '), 'foo bar'); + equals(_.clean(1), '1'); + }); + + test('String: count', function(){ + equals(_('Hello world').count('l'), 3); + equals(_('Hello world').count('Hello'), 1); + equals(_('Hello world').count('foo'), 0); + equals(_('x.xx....x.x').count('x'), 5); + equals(_(12345).count(1), 1); + equals(_(11345).count(1), 2); + }); + + test('String: insert', function(){ + equals(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); + equals(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); + equals(_(12345).insert(6, 'Jessy'), '12345Jessy'); + }); + + test('String: splice', function(){ + equals(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), + 'https://edtsech@bitbucket.org/epeli/underscore.strings'); + equals(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); + }); + + test('String: succ', function(){ + equals(_('a').succ(), 'b'); + equals(_('A').succ(), 'B'); + equals(_('+').succ(), ','); + equals(_(1).succ(), '2'); + }); + + test('String: titleize', function(){ + equals(_('the titleize string method').titleize(), 'The Titleize String Method'); + equals(_('the titleize string method').titleize(), 'The Titleize String Method'); + equals(_(123).titleize(), '123'); + }); + + test('String: camelize', function(){ + equals(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); + equals(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); + equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); + equals(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); + equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); + equals(_(123).camelize(), '123'); + }); + + test('String: underscored', function(){ + equals(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); + equals(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); + equals(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); + equals(_(' the underscored string method').underscored(), 'the_underscored_string_method'); + equals(_(123).underscored(), '123'); + }); + + test('String: dasherize', function(){ + equals(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); + equals(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); + equals(_('thisIsATest').dasherize(), 'this-is-a-test'); + equals(_('this Is A Test').dasherize(), 'this-is-a-test'); + equals(_('thisIsATest123').dasherize(), 'this-is-a-test123'); + equals(_('123thisIsATest').dasherize(), '123this-is-a-test'); + equals(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); + equals(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); + equals(_('téléphone').dasherize(), 'téléphone'); + equals(_('foo$bar').dasherize(), 'foo$bar'); + equals(_(123).dasherize(), '123'); + }); + + test('String: camelize', function(){ + equals(_.camelize('-moz-transform'), 'MozTransform'); + equals(_.camelize('webkit-transform'), 'webkitTransform'); + equals(_.camelize('under_scored'), 'underScored'); + equals(_.camelize(' with spaces'), 'withSpaces'); + }); + + test('String: join', function(){ + equals(_.join(1, 2, 3, 4), '21314'); + equals(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); + }); + + test('String: classify', function(){ + equals(_.classify(1), '1'); + equals(_('some_class_name').classify(), 'SomeClassName'); + }); + + test('String: humanize', function(){ + equals(_('the_humanize_string_method').humanize(), 'The humanize string method'); + equals(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); + equals(_('the humanize string method').humanize(), 'The humanize string method'); + equals(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); + equals(_('the humanize string method ').humanize(), 'The humanize string method'); + equals(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); + equals(_(123).humanize(), '123'); + }); + + test('String: truncate', function(){ + equals(_('Hello world').truncate(6, 'read more'), 'Hello read more'); + equals(_('Hello world').truncate(5), 'Hello...'); + equals(_('Hello').truncate(10), 'Hello'); + equals(_(1234567890).truncate(5), '12345...'); + }); + + test('String: prune', function(){ + equals(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); + equals(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); + equals(_('Hello, world').prune(5), 'Hello...'); + equals(_('Hello, world').prune(8), 'Hello...'); + equals(_('Hello, cruel world').prune(15), 'Hello, cruel...'); + equals(_('Hello world').prune(22), 'Hello world'); + equals(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); + equals(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); + equals(_('Привет, мир').prune(6), 'Привет...'); + equals(_('Привет, мир').prune(8), 'Привет...'); + equals(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); + equals(_('Привет, мир').prune(22), 'Привет, мир'); + equals(_(123).prune(10), '123'); + equals(_(123).prune(1,1), '11'); + }); + + test('String: isBlank', function(){ + ok(_('').isBlank()); + ok(_(' ').isBlank()); + ok(_('\n').isBlank()); + ok(!_('a').isBlank()); + ok(!_('0').isBlank()); + ok(!_(0).isBlank()); + }); + + test('String: escapeHTML', function(){ + equals(_('
      Blah & "blah" & \'blah\'
      ').escapeHTML(), + '<div>Blah & "blah" & 'blah'</div>'); + equals(_('<').escapeHTML(), '&lt;'); + equals(_(5).escapeHTML(), '5'); + // equals(_(undefined).escapeHTML(), ''); + }); + + test('String: unescapeHTML', function(){ + equals(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), + '
      Blah & "blah" & \'blah\'
      '); + equals(_('&lt;').unescapeHTML(), '<'); + equals(_(''').unescapeHTML(), "'"); + equals(_(''').unescapeHTML(), "'"); + equals(_('J').unescapeHTML(), "J"); + equals(_('J').unescapeHTML(), "J"); + equals(_('J').unescapeHTML(), "J"); + equals(_('&_#39;').unescapeHTML(), "&_#39;"); + equals(_(''_;').unescapeHTML(), "'_;"); + equals(_('&#38;').unescapeHTML(), "&"); + equals(_('&amp;').unescapeHTML(), "&"); + equals(_(5).unescapeHTML(), '5'); + // equals(_(undefined).unescapeHTML(), ''); + }); + + test('String: words', function() { + equals(_("I love you!").words().length, 3); + equals(_(" I love you! ").words().length, 3); + equals(_("I_love_you!").words('_').length, 3); + equals(_("I-love-you!").words(/-/).length, 3); + equals(_(123).words().length, 1); + }); + + test('String: chars', function() { + equals(_("Hello").chars().length, 5); + equals(_(123).chars().length, 3); + }); + + test('String: lines', function() { + equals(_("Hello\nWorld").lines().length, 2); + equals(_("Hello World").lines().length, 1); + equals(_(123).lines().length, 1); + }); + + test('String: pad', function() { + equals(_("1").pad(8), ' 1'); + equals(_(1).pad(8), ' 1'); + equals(_("1").pad(8, '0'), '00000001'); + equals(_("1").pad(8, '0', 'left'), '00000001'); + equals(_("1").pad(8, '0', 'right'), '10000000'); + equals(_("1").pad(8, '0', 'both'), '00001000'); + equals(_("foo").pad(8, '0', 'both'), '000foo00'); + equals(_("foo").pad(7, '0', 'both'), '00foo00'); + equals(_("foo").pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); + }); + + test('String: lpad', function() { + equals(_("1").lpad(8), ' 1'); + equals(_(1).lpad(8), ' 1'); + equals(_("1").lpad(8, '0'), '00000001'); + equals(_("1").lpad(8, '0', 'left'), '00000001'); + }); + + test('String: rpad', function() { + equals(_("1").rpad(8), '1 '); + equals(_(1).lpad(8), ' 1'); + equals(_("1").rpad(8, '0'), '10000000'); + equals(_("foo").rpad(8, '0'), 'foo00000'); + equals(_("foo").rpad(7, '0'), 'foo0000'); + }); + + test('String: lrpad', function() { + equals(_("1").lrpad(8), ' 1 '); + equals(_(1).lrpad(8), ' 1 '); + equals(_("1").lrpad(8, '0'), '00001000'); + equals(_("foo").lrpad(8, '0'), '000foo00'); + equals(_("foo").lrpad(7, '0'), '00foo00'); + equals(_("foo").lrpad(7, '!@$%dofjrofj'), '!!foo!!'); + }); + + test('String: toNumber', function() { + deepEqual(_("not a number").toNumber(), Number.NaN); + equals(_(0).toNumber(), 0); + equals(_("0").toNumber(), 0); + equals(_("0000").toNumber(), 0); + equals(_("2.345").toNumber(), 2); + equals(_("2.345").toNumber(NaN), 2); + equals(_("2.345").toNumber(2), 2.35); + equals(_("2.344").toNumber(2), 2.34); + equals(_("2").toNumber(2), 2.00); + equals(_(2).toNumber(2), 2.00); + equals(_(-2).toNumber(), -2); + equals(_("-2").toNumber(), -2); + }); + + test('String: strRight', function() { + equals(_("This_is_a_test_string").strRight("_"), "is_a_test_string"); + equals(_("This_is_a_test_string").strRight("string"), ""); + equals(_("This_is_a_test_string").strRight(), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strRight(""), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strRight("-"), "This_is_a_test_string"); + equals(_(12345).strRight(2), "345"); + }); + + test('String: strRightBack', function() { + equals(_("This_is_a_test_string").strRightBack("_"), "string"); + equals(_("This_is_a_test_string").strRightBack("string"), ""); + equals(_("This_is_a_test_string").strRightBack(), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strRightBack(""), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strRightBack("-"), "This_is_a_test_string"); + equals(_(12345).strRightBack(2), "345"); + }); + + test('String: strLeft', function() { + equals(_("This_is_a_test_string").strLeft("_"), "This"); + equals(_("This_is_a_test_string").strLeft("This"), ""); + equals(_("This_is_a_test_string").strLeft(), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strLeft(""), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strLeft("-"), "This_is_a_test_string"); + equals(_(123454321).strLeft(3), "12"); + }); + + test('String: strLeftBack', function() { + equals(_("This_is_a_test_string").strLeftBack("_"), "This_is_a_test"); + equals(_("This_is_a_test_string").strLeftBack("This"), ""); + equals(_("This_is_a_test_string").strLeftBack(), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strLeftBack(""), "This_is_a_test_string"); + equals(_("This_is_a_test_string").strLeftBack("-"), "This_is_a_test_string"); + equals(_(123454321).strLeftBack(3), "123454"); + }); + + test('Strings: stripTags', function() { + equals(_('a link').stripTags(), 'a link'); + equals(_('a link + + + + + + + + +

      Underscore.string Test Suite

      +

      +

      +
        +
        +

        Underscore.string Speed Suite

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

        Underscore.string Test Suite

        +

        +

        +
          + + diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/arrays.js new file mode 100644 index 0000000..b3b1ce1 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/arrays.js @@ -0,0 +1,166 @@ +$(document).ready(function() { + + module("Arrays"); + + test("arrays: first", function() { + equals(_.first([1,2,3]), 1, 'can pull out the first element of an array'); + equals(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); + equals(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); + equals(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); + equals(_.first([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to first'); + var result = (function(){ return _.first(arguments); })(4, 3, 2, 1); + equals(result, 4, 'works on an arguments object.'); + result = _.map([[1,2,3],[1,2,3]], _.first); + equals(result.join(','), '1,1', 'works well with _.map'); + }); + + test("arrays: rest", function() { + var numbers = [1, 2, 3, 4]; + equals(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); + equals(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); + equals(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); + var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); + equals(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); + result = _.map([[1,2,3],[1,2,3]], _.rest); + equals(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); + }); + + test("arrays: initial", function() { + equals(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); + equals(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); + var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); + equals(result.join(", "), "1, 2, 3", 'initial works on arguments object'); + result = _.map([[1,2,3],[1,2,3]], _.initial); + equals(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); + }); + + test("arrays: last", function() { + equals(_.last([1,2,3]), 3, 'can pull out the last element of an array'); + equals(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); + equals(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); + equals(_.last([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to last'); + var result = (function(){ return _(arguments).last(); })(1, 2, 3, 4); + equals(result, 4, 'works on an arguments object'); + result = _.map([[1,2,3],[1,2,3]], _.last); + equals(result.join(','), '3,3', 'works well with _.map'); + }); + + test("arrays: compact", function() { + equals(_.compact([0, 1, false, 2, false, 3]).length, 3, 'can trim out all falsy values'); + var result = (function(){ return _(arguments).compact().length; })(0, 1, false, 2, false, 3); + equals(result, 3, 'works on an arguments object'); + }); + + test("arrays: flatten", function() { + if (window.JSON) { + var list = [1, [2], [3, [[[4]]]]]; + equals(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); + equals(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); + var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); + equals(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); + } + }); + + test("arrays: without", function() { + var list = [1, 2, 1, 0, 3, 1, 4]; + equals(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object'); + var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4); + equals(result.join(', '), '2, 3, 4', 'works on an arguments object'); + + var list = [{one : 1}, {two : 2}]; + ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.'); + ok(_.without(list, list[0]).length == 1, 'ditto.'); + }); + + test("arrays: uniq", function() { + var list = [1, 2, 1, 3, 1, 4]; + equals(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); + + var list = [1, 1, 1, 2, 2, 3]; + equals(_.uniq(list, true).join(', '), '1, 2, 3', 'can find the unique values of a sorted array faster'); + + var list = [{name:'moe'}, {name:'curly'}, {name:'larry'}, {name:'curly'}]; + var iterator = function(value) { return value.name; }; + equals(_.map(_.uniq(list, false, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator'); + + var iterator = function(value) { return value +1; }; + var list = [1, 2, 2, 3, 4, 4]; + equals(_.uniq(list, true, iterator).join(', '), '1, 2, 3, 4', 'iterator works with sorted array'); + + var result = (function(){ return _.uniq(arguments); })(1, 2, 1, 3, 1, 4); + equals(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); + }); + + test("arrays: intersection", function() { + var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; + equals(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); + equals(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); + var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); + equals(result.join(''), 'moe', 'works on an arguments object'); + }); + + test("arrays: union", function() { + var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); + equals(result.join(' '), '1 2 3 30 40', 'takes the union of a list of arrays'); + + var result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]); + equals(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); + }); + + test("arrays: difference", function() { + var result = _.difference([1, 2, 3], [2, 30, 40]); + equals(result.join(' '), '1 3', 'takes the difference of two arrays'); + + var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); + equals(result.join(' '), '3 4', 'takes the difference of three arrays'); + }); + + test('arrays: zip', function() { + var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; + var stooges = _.zip(names, ages, leaders); + equals(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); + }); + + test("arrays: indexOf", function() { + var numbers = [1, 2, 3]; + numbers.indexOf = null; + equals(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); + var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); + equals(result, 1, 'works on an arguments object'); + equals(_.indexOf(null, 2), -1, 'handles nulls properly'); + + var numbers = [10, 20, 30, 40, 50], num = 35; + var index = _.indexOf(numbers, num, true); + equals(index, -1, '35 is not in the list'); + + numbers = [10, 20, 30, 40, 50]; num = 40; + index = _.indexOf(numbers, num, true); + equals(index, 3, '40 is in the list'); + + numbers = [1, 40, 40, 40, 40, 40, 40, 40, 50, 60, 70]; num = 40; + index = _.indexOf(numbers, num, true); + equals(index, 1, '40 is in the list'); + }); + + test("arrays: lastIndexOf", function() { + var numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; + numbers.lastIndexOf = null; + equals(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); + equals(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); + var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); + equals(result, 5, 'works on an arguments object'); + equals(_.indexOf(null, 2), -1, 'handles nulls properly'); + }); + + test("arrays: range", function() { + equals(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); + equals(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); + equals(_.range(5, 8).join(' '), '5 6 7', 'range with two arguments a & b, a<b generates an array of elements a,a+1,a+2,...,b-2,b-1'); + equals(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); + equals(_.range(3, 10, 3).join(' '), '3 6 9', 'range with three arguments a & b & c, c < b-a, a < b generates an array of elements a,a+c,a+2c,...,b - (multiplier of a) < c'); + equals(_.range(3, 10, 15).join(''), '3', 'range with three arguments a & b & c, c > b-a, a < b generates an array with a single element, equal to a'); + equals(_.range(12, 7, -2).join(' '), '12 10 8', 'range with three arguments a & b & c, a > b, c < 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b'); + equals(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); + }); + +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/chaining.js new file mode 100644 index 0000000..0e3d5f3 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/chaining.js @@ -0,0 +1,59 @@ +$(document).ready(function() { + + module("Chaining"); + + test("chaining: map/flatten/reduce", function() { + var lyrics = [ + "I'm a lumberjack and I'm okay", + "I sleep all night and I work all day", + "He's a lumberjack and he's okay", + "He sleeps all night and he works all day" + ]; + var counts = _(lyrics).chain() + .map(function(line) { return line.split(''); }) + .flatten() + .reduce(function(hash, l) { + hash[l] = hash[l] || 0; + hash[l]++; + return hash; + }, {}).value(); + ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); + }); + + test("chaining: select/reject/sortBy", function() { + var numbers = [1,2,3,4,5,6,7,8,9,10]; + numbers = _(numbers).chain().select(function(n) { + return n % 2 == 0; + }).reject(function(n) { + return n % 4 == 0; + }).sortBy(function(n) { + return -n; + }).value(); + equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); + }); + + test("chaining: select/reject/sortBy in functional style", function() { + var numbers = [1,2,3,4,5,6,7,8,9,10]; + numbers = _.chain(numbers).select(function(n) { + return n % 2 == 0; + }).reject(function(n) { + return n % 4 == 0; + }).sortBy(function(n) { + return -n; + }).value(); + equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); + }); + + test("chaining: reverse/concat/unshift/pop/map", function() { + var numbers = [1,2,3,4,5]; + numbers = _(numbers).chain() + .reverse() + .concat([5, 5, 5]) + .unshift(17) + .pop() + .map(function(n){ return n * 2; }) + .value(); + equals(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); + }); + +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/collections.js new file mode 100644 index 0000000..cff9763 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/collections.js @@ -0,0 +1,270 @@ +$(document).ready(function() { + + module("Collections"); + + test("collections: each", function() { + _.each([1, 2, 3], function(num, i) { + equals(num, i + 1, 'each iterators provide value and iteration count'); + }); + + var answers = []; + _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5}); + equals(answers.join(', '), '5, 10, 15', 'context object property accessed'); + + answers = []; + _.forEach([1, 2, 3], function(num){ answers.push(num); }); + equals(answers.join(', '), '1, 2, 3', 'aliased as "forEach"'); + + answers = []; + var obj = {one : 1, two : 2, three : 3}; + obj.constructor.prototype.four = 4; + _.each(obj, function(value, key){ answers.push(key); }); + equals(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.'); + delete obj.constructor.prototype.four; + + answer = null; + _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; }); + ok(answer, 'can reference the original collection from inside the iterator'); + + answers = 0; + _.each(null, function(){ ++answers; }); + equals(answers, 0, 'handles a null properly'); + }); + + test('collections: map', function() { + var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); + equals(doubled.join(', '), '2, 4, 6', 'doubled numbers'); + + doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); + equals(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); + + var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); + equals(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); + + var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); + equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); + + var ids = _.map($('div.underscore-test').children(), function(n){ return n.id; }); + ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists'); + + var ids = _.map(document.images, function(n){ return n.id; }); + ok(ids[0] == 'chart_image', 'can use collection methods on HTMLCollections'); + + var ifnull = _.map(null, function(){}); + ok(_.isArray(ifnull) && ifnull.length === 0, 'handles a null properly'); + + var length = _.map(Array(2), function(v) { return v; }).length; + equals(length, 2, "can preserve a sparse array's length"); + }); + + test('collections: reduce', function() { + var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); + equals(sum, 6, 'can sum up an array'); + + var context = {multiplier : 3}; + sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num * this.multiplier; }, 0, context); + equals(sum, 18, 'can reduce with a context object'); + + sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); + equals(sum, 6, 'aliased as "inject"'); + + sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); + equals(sum, 6, 'OO-style reduce'); + + var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); + equals(sum, 6, 'default initial value'); + + var ifnull; + try { + _.reduce(null, function(){}); + } catch (ex) { + ifnull = ex; + } + ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); + + ok(_.reduce(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); + equals(_.reduce([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); + raises(function() { _.reduce([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); + + var sparseArray = []; + sparseArray[0] = 20; + sparseArray[2] = -5; + equals(_.reduce(sparseArray, function(a, b){ return a - b; }), 25, 'initially-sparse arrays with no memo'); + }); + + test('collections: reduceRight', function() { + var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); + equals(list, 'bazbarfoo', 'can perform right folds'); + + var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); + equals(list, 'bazbarfoo', 'aliased as "foldr"'); + + var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); + equals(list, 'bazbarfoo', 'default initial value'); + + var ifnull; + try { + _.reduceRight(null, function(){}); + } catch (ex) { + ifnull = ex; + } + ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); + + ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); + + equals(_.reduceRight([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); + raises(function() { _.reduceRight([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); + + var sparseArray = []; + sparseArray[0] = 20; + sparseArray[2] = -5; + equals(_.reduceRight(sparseArray, function(a, b){ return a - b; }), -25, 'initially-sparse arrays with no memo'); + }); + + test('collections: detect', function() { + var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); + equals(result, 2, 'found the first "2" and broke the loop'); + }); + + test('collections: select', function() { + var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); + equals(evens.join(', '), '2, 4, 6', 'selected each even number'); + + evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); + equals(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); + }); + + test('collections: reject', function() { + var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); + equals(odds.join(', '), '1, 3, 5', 'rejected each even number'); + }); + + test('collections: all', function() { + ok(_.all([], _.identity), 'the empty set'); + ok(_.all([true, true, true], _.identity), 'all true values'); + ok(!_.all([true, false, true], _.identity), 'one false value'); + ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers'); + ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number'); + ok(_.every([true, true, true], _.identity), 'aliased as "every"'); + }); + + test('collections: any', function() { + var nativeSome = Array.prototype.some; + Array.prototype.some = null; + ok(!_.any([]), 'the empty set'); + ok(!_.any([false, false, false]), 'all false values'); + ok(_.any([false, false, true]), 'one true value'); + ok(_.any([null, 0, 'yes', false]), 'a string'); + ok(!_.any([null, 0, '', false]), 'falsy values'); + ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers'); + ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number'); + ok(_.some([false, false, true]), 'aliased as "some"'); + Array.prototype.some = nativeSome; + }); + + test('collections: include', function() { + ok(_.include([1,2,3], 2), 'two is in the array'); + ok(!_.include([1,3,9], 2), 'two is not in the array'); + ok(_.contains({moe:1, larry:3, curly:9}, 3) === true, '_.include on objects checks their values'); + ok(_([1,2,3]).include(2), 'OO-style include'); + }); + + test('collections: invoke', function() { + var list = [[5, 1, 7], [3, 2, 1]]; + var result = _.invoke(list, 'sort'); + equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); + equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); + }); + + test('collections: invoke w/ function reference', function() { + var list = [[5, 1, 7], [3, 2, 1]]; + var result = _.invoke(list, Array.prototype.sort); + equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); + equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); + }); + + // Relevant when using ClojureScript + test('collections: invoke when strings have a call method', function() { + String.prototype.call = function(){return 42;} + var list = [[5, 1, 7], [3, 2, 1]]; + var s = "foo"; + equals(s.call(), 42, "call function exists"); + var result = _.invoke(list, 'sort'); + equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); + equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); + delete String.prototype.call; + equals(s.call, undefined, "call function removed"); + }); + + test('collections: pluck', function() { + var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; + equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); + }); + + test('collections: max', function() { + equals(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); + + var neg = _.max([1, 2, 3], function(num){ return -num; }); + equals(neg, 1, 'can perform a computation-based max'); + + equals(-Infinity, _.max({}), 'Maximum value of an empty object'); + equals(-Infinity, _.max([]), 'Maximum value of an empty array'); + }); + + test('collections: min', function() { + equals(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); + + var neg = _.min([1, 2, 3], function(num){ return -num; }); + equals(neg, 3, 'can perform a computation-based min'); + + equals(Infinity, _.min({}), 'Minimum value of an empty object'); + equals(Infinity, _.min([]), 'Minimum value of an empty array'); + }); + + test('collections: sortBy', function() { + var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; + people = _.sortBy(people, function(person){ return person.age; }); + equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); + }); + + test('collections: groupBy', function() { + var parity = _.groupBy([1, 2, 3, 4, 5, 6], function(num){ return num % 2; }); + ok('0' in parity && '1' in parity, 'created a group for each value'); + equals(parity[0].join(', '), '2, 4, 6', 'put each even number in the right group'); + + var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; + var grouped = _.groupBy(list, 'length'); + equals(grouped['3'].join(' '), 'one two six ten'); + equals(grouped['4'].join(' '), 'four five nine'); + equals(grouped['5'].join(' '), 'three seven eight'); + }); + + test('collections: sortedIndex', function() { + var numbers = [10, 20, 30, 40, 50], num = 35; + var index = _.sortedIndex(numbers, num); + equals(index, 3, '35 should be inserted at index 3'); + }); + + test('collections: shuffle', function() { + var numbers = _.range(10); + var shuffled = _.shuffle(numbers).sort(); + notStrictEqual(numbers, shuffled, 'original object is unmodified'); + equals(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); + }); + + test('collections: toArray', function() { + ok(!_.isArray(arguments), 'arguments object is not an array'); + ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); + var a = [1,2,3]; + ok(_.toArray(a) !== a, 'array is cloned'); + equals(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); + + var numbers = _.toArray({one : 1, two : 2, three : 3}); + equals(numbers.join(', '), '1, 2, 3', 'object flattened into array'); + }); + + test('collections: size', function() { + equals(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); + }); + +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/functions.js new file mode 100644 index 0000000..78721af --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/functions.js @@ -0,0 +1,198 @@ +$(document).ready(function() { + + module("Functions"); + + test("functions: bind", function() { + var context = {name : 'moe'}; + var func = function(arg) { return "name: " + (this.name || arg); }; + var bound = _.bind(func, context); + equals(bound(), 'name: moe', 'can bind a function to a context'); + + bound = _(func).bind(context); + equals(bound(), 'name: moe', 'can do OO-style binding'); + + bound = _.bind(func, null, 'curly'); + equals(bound(), 'name: curly', 'can bind without specifying a context'); + + func = function(salutation, name) { return salutation + ': ' + name; }; + func = _.bind(func, this, 'hello'); + equals(func('moe'), 'hello: moe', 'the function was partially applied in advance'); + + var func = _.bind(func, this, 'curly'); + equals(func(), 'hello: curly', 'the function was completely applied in advance'); + + var func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; }; + func = _.bind(func, this, 'hello', 'moe', 'curly'); + equals(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); + + func = function(context, message) { equals(this, context, message); }; + _.bind(func, 0, 0, 'can bind a function to `0`')(); + _.bind(func, '', '', 'can bind a function to an empty string')(); + _.bind(func, false, false, 'can bind a function to `false`')(); + + // These tests are only meaningful when using a browser without a native bind function + // To test this with a modern browser, set underscore's nativeBind to undefined + var F = function () { return this; }; + var Boundf = _.bind(F, {hello: "moe curly"}); + equal(new Boundf().hello, undefined, "function should not be bound to the context, to comply with ECMAScript 5"); + equal(Boundf().hello, "moe curly", "When called without the new operator, it's OK to be bound to the context"); + }); + + test("functions: bindAll", function() { + var curly = {name : 'curly'}, moe = { + name : 'moe', + getName : function() { return 'name: ' + this.name; }, + sayHi : function() { return 'hi: ' + this.name; } + }; + curly.getName = moe.getName; + _.bindAll(moe, 'getName', 'sayHi'); + curly.sayHi = moe.sayHi; + equals(curly.getName(), 'name: curly', 'unbound function is bound to current object'); + equals(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object'); + + curly = {name : 'curly'}; + moe = { + name : 'moe', + getName : function() { return 'name: ' + this.name; }, + sayHi : function() { return 'hi: ' + this.name; } + }; + _.bindAll(moe); + curly.sayHi = moe.sayHi; + equals(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); + }); + + test("functions: memoize", function() { + var fib = function(n) { + return n < 2 ? n : fib(n - 1) + fib(n - 2); + }; + var fastFib = _.memoize(fib); + equals(fib(10), 55, 'a memoized version of fibonacci produces identical results'); + equals(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); + + var o = function(str) { + return str; + }; + var fastO = _.memoize(o); + equals(o('toString'), 'toString', 'checks hasOwnProperty'); + equals(fastO('toString'), 'toString', 'checks hasOwnProperty'); + }); + + asyncTest("functions: delay", 2, function() { + var delayed = false; + _.delay(function(){ delayed = true; }, 100); + setTimeout(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50); + setTimeout(function(){ ok(delayed, 'delayed the function'); start(); }, 150); + }); + + asyncTest("functions: defer", 1, function() { + var deferred = false; + _.defer(function(bool){ deferred = bool; }, true); + _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); + }); + + asyncTest("functions: throttle", 2, function() { + var counter = 0; + var incr = function(){ counter++; }; + var throttledIncr = _.throttle(incr, 100); + throttledIncr(); throttledIncr(); throttledIncr(); + setTimeout(throttledIncr, 70); + setTimeout(throttledIncr, 120); + setTimeout(throttledIncr, 140); + setTimeout(throttledIncr, 190); + setTimeout(throttledIncr, 220); + setTimeout(throttledIncr, 240); + _.delay(function(){ ok(counter == 1, "incr was called immediately"); }, 30); + _.delay(function(){ ok(counter == 4, "incr was throttled"); start(); }, 400); + }); + + asyncTest("functions: throttle arguments", 2, function() { + var value = 0; + var update = function(val){ value = val; }; + var throttledUpdate = _.throttle(update, 100); + throttledUpdate(1); throttledUpdate(2); throttledUpdate(3); + setTimeout(function(){ throttledUpdate(4); }, 120); + setTimeout(function(){ throttledUpdate(5); }, 140); + setTimeout(function(){ throttledUpdate(6); }, 250); + _.delay(function(){ equals(value, 1, "updated to latest value"); }, 40); + _.delay(function(){ equals(value, 6, "updated to latest value"); start(); }, 400); + }); + + asyncTest("functions: throttle once", 1, function() { + var counter = 0; + var incr = function(){ counter++; }; + var throttledIncr = _.throttle(incr, 100); + throttledIncr(); + _.delay(function(){ ok(counter == 1, "incr was called once"); start(); }, 220); + }); + + asyncTest("functions: throttle twice", 1, function() { + var counter = 0; + var incr = function(){ counter++; }; + var throttledIncr = _.throttle(incr, 100); + throttledIncr(); throttledIncr(); + _.delay(function(){ ok(counter == 2, "incr was called twice"); start(); }, 220); + }); + + asyncTest("functions: debounce", 1, function() { + var counter = 0; + var incr = function(){ counter++; }; + var debouncedIncr = _.debounce(incr, 50); + debouncedIncr(); debouncedIncr(); debouncedIncr(); + setTimeout(debouncedIncr, 30); + setTimeout(debouncedIncr, 60); + setTimeout(debouncedIncr, 90); + setTimeout(debouncedIncr, 120); + setTimeout(debouncedIncr, 150); + _.delay(function(){ ok(counter == 1, "incr was debounced"); start(); }, 220); + }); + + test("functions: once", function() { + var num = 0; + var increment = _.once(function(){ num++; }); + increment(); + increment(); + equals(num, 1); + }); + + test("functions: wrap", function() { + var greet = function(name){ return "hi: " + name; }; + var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); + equals(backwards('moe'), 'hi: moe eom', 'wrapped the saluation function'); + + var inner = function(){ return "Hello "; }; + var obj = {name : "Moe"}; + obj.hi = _.wrap(inner, function(fn){ return fn() + this.name; }); + equals(obj.hi(), "Hello Moe"); + + var noop = function(){}; + var wrapped = _.wrap(noop, function(fn){ return Array.prototype.slice.call(arguments, 0); }); + var ret = wrapped(['whats', 'your'], 'vector', 'victor'); + same(ret, [noop, ['whats', 'your'], 'vector', 'victor']); + }); + + test("functions: compose", function() { + var greet = function(name){ return "hi: " + name; }; + var exclaim = function(sentence){ return sentence + '!'; }; + var composed = _.compose(exclaim, greet); + equals(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); + + composed = _.compose(greet, exclaim); + equals(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); + }); + + test("functions: after", function() { + var testAfter = function(afterAmount, timesCalled) { + var afterCalled = 0; + var after = _.after(afterAmount, function() { + afterCalled++; + }); + while (timesCalled--) after(); + return afterCalled; + }; + + equals(testAfter(5, 5), 1, "after(N) should fire after being called N times"); + equals(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); + equals(testAfter(0, 0), 1, "after(0) should fire immediately"); + }); + +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/objects.js new file mode 100644 index 0000000..0105d60 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/objects.js @@ -0,0 +1,535 @@ +$(document).ready(function() { + + module("Objects"); + + test("objects: keys", function() { + var exception = /object/; + equals(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); + // the test above is not safe because it relies on for-in enumeration order + var a = []; a[1] = 0; + equals(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); + raises(function() { _.keys(null); }, exception, 'throws an error for `null` values'); + raises(function() { _.keys(void 0); }, exception, 'throws an error for `undefined` values'); + raises(function() { _.keys(1); }, exception, 'throws an error for number primitives'); + raises(function() { _.keys('a'); }, exception, 'throws an error for string primitives'); + raises(function() { _.keys(true); }, exception, 'throws an error for boolean primitives'); + }); + + test("objects: values", function() { + equals(_.values({one : 1, two : 2}).join(', '), '1, 2', 'can extract the values from an object'); + }); + + test("objects: functions", function() { + var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; + ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); + + var Animal = function(){}; + Animal.prototype.run = function(){}; + equals(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); + }); + + test("objects: extend", function() { + var result; + equals(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); + equals(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); + equals(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); + result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); + ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); + result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); + ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); + result = _.extend({}, {a: void 0, b: null}); + equals(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); + }); + + test("objects: defaults", function() { + var result; + var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; + + _.defaults(options, {zero: 1, one: 10, twenty: 20}); + equals(options.zero, 0, 'value exists'); + equals(options.one, 1, 'value exists'); + equals(options.twenty, 20, 'default applied'); + + _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); + equals(options.empty, "", 'value exists'); + ok(_.isNaN(options.nan), "NaN isn't overridden"); + equals(options.word, "word", 'new value is added, first one wins'); + }); + + test("objects: clone", function() { + var moe = {name : 'moe', lucky : [13, 27, 34]}; + var clone = _.clone(moe); + equals(clone.name, 'moe', 'the clone as the attributes of the original'); + + clone.name = 'curly'; + ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); + + clone.lucky.push(101); + equals(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); + + equals(_.clone(undefined), void 0, 'non objects should not be changed by clone'); + equals(_.clone(1), 1, 'non objects should not be changed by clone'); + equals(_.clone(null), null, 'non objects should not be changed by clone'); + }); + + test("objects: isEqual", function() { + function First() { + this.value = 1; + } + First.prototype.value = 1; + function Second() { + this.value = 1; + } + Second.prototype.value = 2; + + // Basic equality and identity comparisons. + ok(_.isEqual(null, null), "`null` is equal to `null`"); + ok(_.isEqual(), "`undefined` is equal to `undefined`"); + + ok(!_.isEqual(0, -0), "`0` is not equal to `-0`"); + ok(!_.isEqual(-0, 0), "Commutative equality is implemented for `0` and `-0`"); + ok(!_.isEqual(null, undefined), "`null` is not equal to `undefined`"); + ok(!_.isEqual(undefined, null), "Commutative equality is implemented for `null` and `undefined`"); + + // String object and primitive comparisons. + ok(_.isEqual("Curly", "Curly"), "Identical string primitives are equal"); + ok(_.isEqual(new String("Curly"), new String("Curly")), "String objects with identical primitive values are equal"); + ok(_.isEqual(new String("Curly"), "Curly"), "String primitives and their corresponding object wrappers are equal"); + ok(_.isEqual("Curly", new String("Curly")), "Commutative equality is implemented for string objects and primitives"); + + ok(!_.isEqual("Curly", "Larry"), "String primitives with different values are not equal"); + ok(!_.isEqual(new String("Curly"), new String("Larry")), "String objects with different primitive values are not equal"); + ok(!_.isEqual(new String("Curly"), {toString: function(){ return "Curly"; }}), "String objects and objects with a custom `toString` method are not equal"); + + // Number object and primitive comparisons. + ok(_.isEqual(75, 75), "Identical number primitives are equal"); + ok(_.isEqual(new Number(75), new Number(75)), "Number objects with identical primitive values are equal"); + ok(_.isEqual(75, new Number(75)), "Number primitives and their corresponding object wrappers are equal"); + ok(_.isEqual(new Number(75), 75), "Commutative equality is implemented for number objects and primitives"); + ok(!_.isEqual(new Number(0), -0), "`new Number(0)` and `-0` are not equal"); + ok(!_.isEqual(0, new Number(-0)), "Commutative equality is implemented for `new Number(0)` and `-0`"); + + ok(!_.isEqual(new Number(75), new Number(63)), "Number objects with different primitive values are not equal"); + ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), "Number objects and objects with a `valueOf` method are not equal"); + + // Comparisons involving `NaN`. + ok(_.isEqual(NaN, NaN), "`NaN` is equal to `NaN`"); + ok(!_.isEqual(61, NaN), "A number primitive is not equal to `NaN`"); + ok(!_.isEqual(new Number(79), NaN), "A number object is not equal to `NaN`"); + ok(!_.isEqual(Infinity, NaN), "`Infinity` is not equal to `NaN`"); + + // Boolean object and primitive comparisons. + ok(_.isEqual(true, true), "Identical boolean primitives are equal"); + ok(_.isEqual(new Boolean, new Boolean), "Boolean objects with identical primitive values are equal"); + ok(_.isEqual(true, new Boolean(true)), "Boolean primitives and their corresponding object wrappers are equal"); + ok(_.isEqual(new Boolean(true), true), "Commutative equality is implemented for booleans"); + ok(!_.isEqual(new Boolean(true), new Boolean), "Boolean objects with different primitive values are not equal"); + + // Common type coercions. + ok(!_.isEqual(true, new Boolean(false)), "Boolean objects are not equal to the boolean primitive `true`"); + ok(!_.isEqual("75", 75), "String and number primitives with like values are not equal"); + ok(!_.isEqual(new Number(63), new String(63)), "String and number objects with like values are not equal"); + ok(!_.isEqual(75, "75"), "Commutative equality is implemented for like string and number values"); + ok(!_.isEqual(0, ""), "Number and string primitives with like values are not equal"); + ok(!_.isEqual(1, true), "Number and boolean primitives with like values are not equal"); + ok(!_.isEqual(new Boolean(false), new Number(0)), "Boolean and number objects with like values are not equal"); + ok(!_.isEqual(false, new String("")), "Boolean primitives and string objects with like values are not equal"); + ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), "Dates and their corresponding numeric primitive values are not equal"); + + // Dates. + ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), "Date objects referencing identical times are equal"); + ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), "Date objects referencing different times are not equal"); + ok(!_.isEqual(new Date(2009, 11, 13), { + getTime: function(){ + return 12606876e5; + } + }), "Date objects and objects with a `getTime` method are not equal"); + ok(!_.isEqual(new Date("Curly"), new Date("Curly")), "Invalid dates are not equal"); + + // Functions. + ok(!_.isEqual(First, Second), "Different functions with identical bodies and source code representations are not equal"); + + // RegExps. + ok(_.isEqual(/(?:)/gim, /(?:)/gim), "RegExps with equivalent patterns and flags are equal"); + ok(!_.isEqual(/(?:)/g, /(?:)/gi), "RegExps with equivalent patterns and different flags are not equal"); + ok(!_.isEqual(/Moe/gim, /Curly/gim), "RegExps with different patterns and equivalent flags are not equal"); + ok(!_.isEqual(/(?:)/gi, /(?:)/g), "Commutative equality is implemented for RegExps"); + ok(!_.isEqual(/Curly/g, {source: "Larry", global: true, ignoreCase: false, multiline: false}), "RegExps and RegExp-like objects are not equal"); + + // Empty arrays, array-like objects, and object literals. + ok(_.isEqual({}, {}), "Empty object literals are equal"); + ok(_.isEqual([], []), "Empty array literals are equal"); + ok(_.isEqual([{}], [{}]), "Empty nested arrays and objects are equal"); + ok(!_.isEqual({length: 0}, []), "Array-like objects and arrays are not equal."); + ok(!_.isEqual([], {length: 0}), "Commutative equality is implemented for array-like objects"); + + ok(!_.isEqual({}, []), "Object literals and array literals are not equal"); + ok(!_.isEqual([], {}), "Commutative equality is implemented for objects and arrays"); + + // Arrays with primitive and object values. + ok(_.isEqual([1, "Larry", true], [1, "Larry", true]), "Arrays containing identical primitives are equal"); + ok(_.isEqual([/Moe/g, new Date(2009, 9, 25)], [/Moe/g, new Date(2009, 9, 25)]), "Arrays containing equivalent elements are equal"); + + // Multi-dimensional arrays. + var a = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; + var b = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; + ok(_.isEqual(a, b), "Arrays containing nested arrays and objects are recursively compared"); + + // Overwrite the methods defined in ES 5.1 section 15.4.4. + a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null; + b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null; + + // Array elements and properties. + ok(_.isEqual(a, b), "Arrays containing equivalent elements and different non-numeric properties are equal"); + a.push("White Rocks"); + ok(!_.isEqual(a, b), "Arrays of different lengths are not equal"); + a.push("East Boulder"); + b.push("Gunbarrel Ranch", "Teller Farm"); + ok(!_.isEqual(a, b), "Arrays of identical lengths containing different elements are not equal"); + + // Sparse arrays. + ok(_.isEqual(Array(3), Array(3)), "Sparse arrays of identical lengths are equal"); + ok(!_.isEqual(Array(3), Array(6)), "Sparse arrays of different lengths are not equal when both are empty"); + + // According to the Microsoft deviations spec, section 2.1.26, JScript 5.x treats `undefined` + // elements in arrays as elisions. Thus, sparse arrays and dense arrays containing `undefined` + // values are equivalent. + if (0 in [undefined]) { + ok(!_.isEqual(Array(3), [undefined, undefined, undefined]), "Sparse and dense arrays are not equal"); + ok(!_.isEqual([undefined, undefined, undefined], Array(3)), "Commutative equality is implemented for sparse and dense arrays"); + } + + // Simple objects. + ok(_.isEqual({a: "Curly", b: 1, c: true}, {a: "Curly", b: 1, c: true}), "Objects containing identical primitives are equal"); + ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), "Objects containing equivalent members are equal"); + ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), "Objects of identical sizes with different values are not equal"); + ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), "Objects of identical sizes with different property names are not equal"); + ok(!_.isEqual({a: 1, b: 2}, {a: 1}), "Objects of different sizes are not equal"); + ok(!_.isEqual({a: 1}, {a: 1, b: 2}), "Commutative equality is implemented for objects"); + ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), "Objects with identical keys and different values are not equivalent"); + + // `A` contains nested objects and arrays. + a = { + name: new String("Moe Howard"), + age: new Number(77), + stooge: true, + hobbies: ["acting"], + film: { + name: "Sing a Song of Six Pants", + release: new Date(1947, 9, 30), + stars: [new String("Larry Fine"), "Shemp Howard"], + minutes: new Number(16), + seconds: 54 + } + }; + + // `B` contains equivalent nested objects and arrays. + b = { + name: new String("Moe Howard"), + age: new Number(77), + stooge: true, + hobbies: ["acting"], + film: { + name: "Sing a Song of Six Pants", + release: new Date(1947, 9, 30), + stars: [new String("Larry Fine"), "Shemp Howard"], + minutes: new Number(16), + seconds: 54 + } + }; + ok(_.isEqual(a, b), "Objects with nested equivalent members are recursively compared"); + + // Instances. + ok(_.isEqual(new First, new First), "Object instances are equal"); + ok(!_.isEqual(new First, new Second), "Objects with different constructors and identical own properties are not equal"); + ok(!_.isEqual({value: 1}, new First), "Object instances and objects sharing equivalent properties are not equal"); + ok(!_.isEqual({value: 2}, new Second), "The prototype chain of objects should not be examined"); + + // Circular Arrays. + (a = []).push(a); + (b = []).push(b); + ok(_.isEqual(a, b), "Arrays containing circular references are equal"); + a.push(new String("Larry")); + b.push(new String("Larry")); + ok(_.isEqual(a, b), "Arrays containing circular references and equivalent properties are equal"); + a.push("Shemp"); + b.push("Curly"); + ok(!_.isEqual(a, b), "Arrays containing circular references and different properties are not equal"); + + // Circular Objects. + a = {abc: null}; + b = {abc: null}; + a.abc = a; + b.abc = b; + ok(_.isEqual(a, b), "Objects containing circular references are equal"); + a.def = 75; + b.def = 75; + ok(_.isEqual(a, b), "Objects containing circular references and equivalent properties are equal"); + a.def = new Number(75); + b.def = new Number(63); + ok(!_.isEqual(a, b), "Objects containing circular references and different properties are not equal"); + + // Cyclic Structures. + a = [{abc: null}]; + b = [{abc: null}]; + (a[0].abc = a).push(a); + (b[0].abc = b).push(b); + ok(_.isEqual(a, b), "Cyclic structures are equal"); + a[0].def = "Larry"; + b[0].def = "Larry"; + ok(_.isEqual(a, b), "Cyclic structures containing equivalent properties are equal"); + a[0].def = new String("Larry"); + b[0].def = new String("Curly"); + ok(!_.isEqual(a, b), "Cyclic structures containing different properties are not equal"); + + // Complex Circular References. + a = {foo: {b: {foo: {c: {foo: null}}}}}; + b = {foo: {b: {foo: {c: {foo: null}}}}}; + a.foo.b.foo.c.foo = a; + b.foo.b.foo.c.foo = b; + ok(_.isEqual(a, b), "Cyclic structures with nested and identically-named properties are equal"); + + // Chaining. + ok(!_.isEqual(_({x: 1, y: undefined}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); + equals(_({x: 1, y: 2}).chain().isEqual(_({x: 1, y: 2}).chain()).value(), true, '`isEqual` can be chained'); + + // Custom `isEqual` methods. + var isEqualObj = {isEqual: function (o) { return o.isEqual == this.isEqual; }, unique: {}}; + var isEqualObjClone = {isEqual: isEqualObj.isEqual, unique: {}}; + + ok(_.isEqual(isEqualObj, isEqualObjClone), 'Both objects implement identical `isEqual` methods'); + ok(_.isEqual(isEqualObjClone, isEqualObj), 'Commutative equality is implemented for objects with custom `isEqual` methods'); + ok(!_.isEqual(isEqualObj, {}), 'Objects that do not implement equivalent `isEqual` methods are not equal'); + ok(!_.isEqual({}, isEqualObj), 'Commutative equality is implemented for objects with different `isEqual` methods'); + + // Custom `isEqual` methods - comparing different types + LocalizedString = (function() { + function LocalizedString(id) { this.id = id; this.string = (this.id===10)? 'Bonjour': ''; } + LocalizedString.prototype.isEqual = function(that) { + if (_.isString(that)) return this.string == that; + else if (that instanceof LocalizedString) return this.id == that.id; + return false; + }; + return LocalizedString; + })(); + var localized_string1 = new LocalizedString(10), localized_string2 = new LocalizedString(10), localized_string3 = new LocalizedString(11); + ok(_.isEqual(localized_string1, localized_string2), 'comparing same typed instances with same ids'); + ok(!_.isEqual(localized_string1, localized_string3), 'comparing same typed instances with different ids'); + ok(_.isEqual(localized_string1, 'Bonjour'), 'comparing different typed instances with same values'); + ok(_.isEqual('Bonjour', localized_string1), 'comparing different typed instances with same values'); + ok(!_.isEqual('Bonjour', localized_string3), 'comparing two localized strings with different ids'); + ok(!_.isEqual(localized_string1, 'Au revoir'), 'comparing different typed instances with different values'); + ok(!_.isEqual('Au revoir', localized_string1), 'comparing different typed instances with different values'); + + // Custom `isEqual` methods - comparing with serialized data + Date.prototype.toJSON = function() { + return { + _type:'Date', + year:this.getUTCFullYear(), + month:this.getUTCMonth(), + day:this.getUTCDate(), + hours:this.getUTCHours(), + minutes:this.getUTCMinutes(), + seconds:this.getUTCSeconds() + }; + }; + Date.prototype.isEqual = function(that) { + var this_date_components = this.toJSON(); + var that_date_components = (that instanceof Date) ? that.toJSON() : that; + delete this_date_components['_type']; delete that_date_components['_type'] + return _.isEqual(this_date_components, that_date_components); + }; + + var date = new Date(); + var date_json = { + _type:'Date', + year:date.getUTCFullYear(), + month:date.getUTCMonth(), + day:date.getUTCDate(), + hours:date.getUTCHours(), + minutes:date.getUTCMinutes(), + seconds:date.getUTCSeconds() + }; + + ok(_.isEqual(date_json, date), 'serialized date matches date'); + ok(_.isEqual(date, date_json), 'date matches serialized date'); + }); + + test("objects: isEmpty", function() { + ok(!_([1]).isEmpty(), '[1] is not empty'); + ok(_.isEmpty([]), '[] is empty'); + ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); + ok(_.isEmpty({}), '{} is empty'); + ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); + ok(_.isEmpty(null), 'null is empty'); + ok(_.isEmpty(), 'undefined is empty'); + ok(_.isEmpty(''), 'the empty string is empty'); + ok(!_.isEmpty('moe'), 'but other strings are not'); + + var obj = {one : 1}; + delete obj.one; + ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); + }); + + // Setup remote variables for iFrame tests. + var iframe = document.createElement('iframe'); + jQuery(iframe).appendTo(document.body); + var iDoc = iframe.contentDocument || iframe.contentWindow.document; + iDoc.write( + "" + ); + iDoc.close(); + + test("objects: isElement", function() { + ok(!_.isElement('div'), 'strings are not dom elements'); + ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); + ok(_.isElement(iElement), 'even from another frame'); + }); + + test("objects: isArguments", function() { + var args = (function(){ return arguments; })(1, 2, 3); + ok(!_.isArguments('string'), 'a string is not an arguments object'); + ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); + ok(_.isArguments(args), 'but the arguments object is an arguments object'); + ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); + ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); + ok(_.isArguments(iArguments), 'even from another frame'); + }); + + test("objects: isObject", function() { + ok(_.isObject(arguments), 'the arguments object is object'); + ok(_.isObject([1, 2, 3]), 'and arrays'); + ok(_.isObject($('html')[0]), 'and DOM element'); + ok(_.isObject(iElement), 'even from another frame'); + ok(_.isObject(function () {}), 'and functions'); + ok(_.isObject(iFunction), 'even from another frame'); + ok(!_.isObject(null), 'but not null'); + ok(!_.isObject(undefined), 'and not undefined'); + ok(!_.isObject('string'), 'and not string'); + ok(!_.isObject(12), 'and not number'); + ok(!_.isObject(true), 'and not boolean'); + ok(_.isObject(new String('string')), 'but new String()'); + }); + + test("objects: isArray", function() { + ok(!_.isArray(arguments), 'the arguments object is not an array'); + ok(_.isArray([1, 2, 3]), 'but arrays are'); + ok(_.isArray(iArray), 'even from another frame'); + }); + + test("objects: isString", function() { + ok(!_.isString(document.body), 'the document body is not a string'); + ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); + ok(_.isString(iString), 'even from another frame'); + }); + + test("objects: isNumber", function() { + ok(!_.isNumber('string'), 'a string is not a number'); + ok(!_.isNumber(arguments), 'the arguments object is not a number'); + ok(!_.isNumber(undefined), 'undefined is not a number'); + ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); + ok(_.isNumber(NaN), 'NaN *is* a number'); + ok(_.isNumber(Infinity), 'Infinity is a number'); + ok(_.isNumber(iNumber), 'even from another frame'); + ok(!_.isNumber('1'), 'numeric strings are not numbers'); + }); + + test("objects: isBoolean", function() { + ok(!_.isBoolean(2), 'a number is not a boolean'); + ok(!_.isBoolean("string"), 'a string is not a boolean'); + ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); + ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); + ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); + ok(!_.isBoolean(undefined), 'undefined is not a boolean'); + ok(!_.isBoolean(NaN), 'NaN is not a boolean'); + ok(!_.isBoolean(null), 'null is not a boolean'); + ok(_.isBoolean(true), 'but true is'); + ok(_.isBoolean(false), 'and so is false'); + ok(_.isBoolean(iBoolean), 'even from another frame'); + }); + + test("objects: isFunction", function() { + ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); + ok(!_.isFunction('moe'), 'strings are not functions'); + ok(_.isFunction(_.isFunction), 'but functions are'); + ok(_.isFunction(iFunction), 'even from another frame'); + }); + + test("objects: isDate", function() { + ok(!_.isDate(100), 'numbers are not dates'); + ok(!_.isDate({}), 'objects are not dates'); + ok(_.isDate(new Date()), 'but dates are'); + ok(_.isDate(iDate), 'even from another frame'); + }); + + test("objects: isRegExp", function() { + ok(!_.isRegExp(_.identity), 'functions are not RegExps'); + ok(_.isRegExp(/identity/), 'but RegExps are'); + ok(_.isRegExp(iRegExp), 'even from another frame'); + }); + + test("objects: isNaN", function() { + ok(!_.isNaN(undefined), 'undefined is not NaN'); + ok(!_.isNaN(null), 'null is not NaN'); + ok(!_.isNaN(0), '0 is not NaN'); + ok(_.isNaN(NaN), 'but NaN is'); + ok(_.isNaN(iNaN), 'even from another frame'); + }); + + test("objects: isNull", function() { + ok(!_.isNull(undefined), 'undefined is not null'); + ok(!_.isNull(NaN), 'NaN is not null'); + ok(_.isNull(null), 'but null is'); + ok(_.isNull(iNull), 'even from another frame'); + }); + + test("objects: isUndefined", function() { + ok(!_.isUndefined(1), 'numbers are defined'); + ok(!_.isUndefined(null), 'null is defined'); + ok(!_.isUndefined(false), 'false is defined'); + ok(!_.isUndefined(NaN), 'NaN is defined'); + ok(_.isUndefined(), 'nothing is undefined'); + ok(_.isUndefined(undefined), 'undefined is undefined'); + ok(_.isUndefined(iUndefined), 'even from another frame'); + }); + + if (window.ActiveXObject) { + test("objects: IE host objects", function() { + var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); + ok(!_.isNumber(xml)); + ok(!_.isBoolean(xml)); + ok(!_.isNaN(xml)); + ok(!_.isFunction(xml)); + ok(!_.isNull(xml)); + ok(!_.isUndefined(xml)); + }); + } + + test("objects: tap", function() { + var intercepted = null; + var interceptor = function(obj) { intercepted = obj; }; + var returned = _.tap(1, interceptor); + equals(intercepted, 1, "passes tapped object to interceptor"); + equals(returned, 1, "returns tapped object"); + + returned = _([1,2,3]).chain(). + map(function(n){ return n * 2; }). + max(). + tap(interceptor). + value(); + ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); + }); +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/speed.js new file mode 100644 index 0000000..86663a2 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/speed.js @@ -0,0 +1,70 @@ +(function() { + + var numbers = []; + for (var i=0; i<1000; i++) numbers.push(i); + var objects = _.map(numbers, function(n){ return {num : n}; }); + var randomized = _.sortBy(numbers, function(){ return Math.random(); }); + + JSLitmus.test('_.each()', function() { + var timesTwo = []; + _.each(numbers, function(num){ timesTwo.push(num * 2); }); + return timesTwo; + }); + + JSLitmus.test('_(list).each()', function() { + var timesTwo = []; + _(numbers).each(function(num){ timesTwo.push(num * 2); }); + return timesTwo; + }); + + JSLitmus.test('jQuery.each()', function() { + var timesTwo = []; + jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); + return timesTwo; + }); + + JSLitmus.test('_.map()', function() { + return _.map(objects, function(obj){ return obj.num; }); + }); + + JSLitmus.test('jQuery.map()', function() { + return jQuery.map(objects, function(obj){ return obj.num; }); + }); + + JSLitmus.test('_.pluck()', function() { + return _.pluck(objects, 'num'); + }); + + JSLitmus.test('_.uniq()', function() { + return _.uniq(randomized); + }); + + JSLitmus.test('_.uniq() (sorted)', function() { + return _.uniq(numbers, true); + }); + + JSLitmus.test('_.sortBy()', function() { + return _.sortBy(numbers, function(num){ return -num; }); + }); + + JSLitmus.test('_.isEqual()', function() { + return _.isEqual(numbers, randomized); + }); + + JSLitmus.test('_.keys()', function() { + return _.keys(objects); + }); + + JSLitmus.test('_.values()', function() { + return _.values(objects); + }); + + JSLitmus.test('_.intersect()', function() { + return _.intersect(numbers, randomized); + }); + + JSLitmus.test('_.range()', function() { + return _.range(1000); + }); + +})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js new file mode 100644 index 0000000..68c39dc --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js @@ -0,0 +1,27 @@ +(function() { + + var func = function(){}; + var date = new Date(); + var str = "a string"; + var numbers = []; + for (var i=0; i<1000; i++) numbers.push(i); + var objects = _.map(numbers, function(n){ return {num : n}; }); + var randomized = _.sortBy(numbers, function(){ return Math.random(); }); + + JSLitmus.test('_.isNumber', function() { + return _.isNumber(1000) + }); + + JSLitmus.test('_.newIsNumber', function() { + return _.newIsNumber(1000) + }); + + JSLitmus.test('_.isNumber(NaN)', function() { + return _.isNumber(NaN) + }); + + JSLitmus.test('_.newIsNumber(NaN)', function() { + return _.newIsNumber(NaN) + }); + +})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html new file mode 100644 index 0000000..bd34f9d --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html @@ -0,0 +1,19 @@ + + + + Underscore Temporary Tests + + + + + + + +

          Underscore Temporary Tests

          +

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

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

          Underscore Test Suite

          +

          +

          +
            +
            +

            Underscore Speed Suite

            +

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

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

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

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

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

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

            "); + + var quoteTemplate = _.template("It's its, not it's"); + equals(quoteTemplate({}), "It's its, not it's"); + + var quoteInStatementAndBody = _.template("<%\ + if(foo == 'bar'){ \ + %>Statement quotes and 'quotes'.<% } %>"); + equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); + + var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); + equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); + + var template = _.template("<%- value %>"); + var result = template({value: "\n\n```\n\nBrowser support was done mostly for online demo. If you find any errors - feel\nfree to send pull requests with fixes. Also note, that IE and other old browsers\nneeds [es5-shims](https://github.com/kriskowal/es5-shim) to operate.\n\n\nAPI\n---\n\nHere we cover the most 'useful' methods. If you need advanced details (creating\nyour own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more\ninfo.\n\nIn node.js JS-YAML automatically registers handlers for `.yml` and `.yaml`\nfiles. You can load them just with `require`. That's mostly equivalent to\ncalling `load()` on fetched content of a file. Just with one string!\n\n``` javascript\nrequire('js-yaml');\n\n// Get document, or throw exception on error\ntry {\n var doc = require('/home/ixti/example.yml');\n console.log(doc);\n} catch (e) {\n console.log(e);\n}\n```\n\n\n### load (string [ , options ])\n\nParses `string` as single YAML document. Returns a JavaScript object or throws\n`YAMLException` on error.\n\nNOTE: This function **does not** understands multi-document sources, it throws\nexception on those.\n\noptions:\n\n- `filename` _(default: null)_ - string to be used as a file path in\n error/warning messages.\n- `strict` _(default - false)_ makes the loader to throw errors instead of\n warnings.\n- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use.\n\n\n### loadAll (string, iterator [ , options ])\n\nSame as `load()`, but understands multi-document sources and apply `iterator` to\neach document.\n\n``` javascript\nvar yaml = require('js-yaml');\n\nyaml.loadAll(data, function (doc) {\n console.log(doc);\n});\n```\n\n\n### safeLoad (string [ , options ])\n\nSame as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### safeLoadAll (string, iterator [ , options ])\n\nSame as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### dump (object [ , options ])\n\nSerializes `object` as YAML document.\n\noptions:\n\n- `indent` _(default: 2)_ - indentation width to use (in spaces).\n- `flowLevel` (default: -1) - specifies level of nesting, when to switch from\n block to flow style for collections. -1 means block style everwhere\n- `styles` - \"tag\" => \"style\" map. Each tag may have own set of styles.\n- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use.\n\nstyles:\n\n``` none\n!!null\n \"canonical\" => \"~\"\n\n!!int\n \"binary\" => \"0b1\", \"0b101010\", \"0b1110001111010\"\n \"octal\" => \"01\", \"052\", \"016172\"\n \"decimal\" => \"1\", \"42\", \"7290\"\n \"hexadecimal\" => \"0x1\", \"0x2A\", \"0x1C7A\"\n\n!!null, !!bool, !!float\n \"lowercase\" => \"null\", \"true\", \"false\", \".nan\", '.inf'\n \"uppercase\" => \"NULL\", \"TRUE\", \"FALSE\", \".NAN\", '.INF'\n \"camelcase\" => \"Null\", \"True\", \"False\", \".NaN\", '.Inf'\n```\n\nBy default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`.\n\n\n### safeDump (object [ , options ])\n\nSame as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\nSupported YAML types\n--------------------\n\nThe list of standard YAML tags and corresponding JavaScipt types. See also\n[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and\n[YAML types repository](http://yaml.org/type/).\n\n```\n!!null '' # null\n!!bool 'yes' # bool\n!!int '3...' # number\n!!float '3.14...' # number\n!!binary '...base64...' # buffer\n!!timestamp 'YYYY-...' # date\n!!omap [ ... ] # array of key-value pairs\n!!pairs [ ... ] # array or array pairs\n!!set { ... } # array of objects with given keys and null values\n!!str '...' # string\n!!seq [ ... ] # array\n!!map { ... } # object\n```\n\n**JavaScript-specific tags**\n\n```\n!!js/regexp /pattern/gim # RegExp\n!!js/undefined '' # Undefined\n!!js/function 'function () {...}' # Function\n```\n\n\n\n\n## Caveats\n\nNote, that you use arrays or objects as key in JS-YAML. JS do not allows objects\nor array as keys, and stringifies (by calling .toString method) them at the\nmoment of adding them.\n\n``` yaml\n---\n? [ foo, bar ]\n: - baz\n? { foo: bar }\n: - baz\n - baz\n```\n\n``` javascript\n{ \"foo,bar\": [\"baz\"], \"[object Object]\": [\"baz\", \"baz\"] }\n```\n\nAlso, reading of properties on implicit block mapping keys is not supported yet.\nSo, the following YAML document cannot be loaded.\n\n``` yaml\n&anchor foo:\n foo: bar\n *anchor: duplicate key\n baz: bat\n *anchor: duplicate key\n```\n\n## License\n\nView the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file\n(MIT).\n", "readmeFilename": "README.md", "_id": "js-yaml@2.0.5", - "_from": "js-yaml@>=2.0.5 <2.1.0" + "_from": "js-yaml@2.0.5" } diff --git a/node_modules/grunt/node_modules/lodash/package.json b/node_modules/grunt/node_modules/lodash/package.json index 9cae14c..9a21c80 100644 --- a/node_modules/grunt/node_modules/lodash/package.json +++ b/node_modules/grunt/node_modules/lodash/package.json @@ -58,5 +58,5 @@ "readme": "# Lo-Dash v0.9.2\n\nA utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).\n\n## Download\n\n * [Development build](https://raw.github.com/lodash/lodash/0.9.2/lodash.js)\n * [Production build](https://raw.github.com/lodash/lodash/0.9.2/lodash.min.js)\n * [Underscore build](https://raw.github.com/lodash/lodash/0.9.2/lodash.underscore.min.js) tailored for projects already using Underscore\n * CDN copies of ≤ v0.9.2’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)\n * For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need\n\n## Dive in\n\nWe’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).\n\nCreate your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones.\n\nFor a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).\n\n## Screencasts\n\nFor more information check out these screencasts over Lo-Dash:\n\n * [Introducing Lo-Dash](https://vimeo.com/44154599)\n * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)\n * [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600)\n * [Unit testing in Lo-Dash](https://vimeo.com/45865290)\n * [Lo-Dash’s approach to native method use](https://vimeo.com/48576012)\n\n## Features\n\n * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)\n * [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning\n * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument\n * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early\n * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties\n * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties\n * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor\n * [_.lateBind](http://lodash.com/docs#lateBind) for late binding\n * [_.merge](http://lodash.com/docs#merge) for a *“deep”* [_.extend](http://lodash.com/docs#extend)\n * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding\n * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments\n * [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging\n * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),\n [and more…](http://lodash.com/docs \"_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where\") accept strings\n\n## Support\n\nLo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.\n\n## Installation and usage\n\nIn browsers:\n\n```html\n\n```\n\nUsing [npm](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n```\n\n**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Resolved Underscore.js issues\n\n * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L545-551)]\n * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L558-582)]\n * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L140-146)]\n * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L747-752)]\n * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L828-840)]\n * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L921-923)]\n * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L1337-1340)]\n\n## Release Notes\n\n### v0.9.2\n\n * Added `fromIndex` argument to `_.contains`\n * Added `moduleId` build option\n * Added Closure Compiler *“simple”* optimizations to the build process\n * Added support for strings in `_.max` and `_.min`\n * Added support for ES6 template delimiters to `_.template`\n * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs\n * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq`\n\nThe full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", "readmeFilename": "README.md", "_id": "lodash@0.9.2", - "_from": "lodash@>=0.9.2 <0.10.0" + "_from": "lodash@0.9.2" } diff --git a/node_modules/grunt/node_modules/minimatch/package.json b/node_modules/grunt/node_modules/minimatch/package.json index dd3c045..d70c7b8 100644 --- a/node_modules/grunt/node_modules/minimatch/package.json +++ b/node_modules/grunt/node_modules/minimatch/package.json @@ -36,5 +36,5 @@ }, "homepage": "https://github.com/isaacs/minimatch", "_id": "minimatch@0.2.14", - "_from": "minimatch@>=0.2.12 <0.3.0" + "_from": "minimatch@0.2.14" } diff --git a/node_modules/grunt/node_modules/nopt/package.json b/node_modules/grunt/node_modules/nopt/package.json index 0e95dfc..3ade296 100644 --- a/node_modules/grunt/node_modules/nopt/package.json +++ b/node_modules/grunt/node_modules/nopt/package.json @@ -32,5 +32,5 @@ }, "homepage": "https://github.com/isaacs/nopt", "_id": "nopt@1.0.10", - "_from": "nopt@>=1.0.10 <1.1.0" + "_from": "nopt@1.0.10" } diff --git a/node_modules/grunt/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/underscore.string/package.json index df8c187..c52dddd 100644 --- a/node_modules/grunt/node_modules/underscore.string/package.json +++ b/node_modules/grunt/node_modules/underscore.string/package.json @@ -68,5 +68,5 @@ "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
            Blah blah blah
            ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
            Blah blah blah
            '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=\" \")\n\nSplit string by delimiter (String or RegExp), ' ' by default.\n\n```javascript\n_.words(\"I love you\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n## Changelog ##\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n\n* Esa-Matti Suuronen (),\n* Edward Tsech ,\n* Sasha Koss (),\n* Vladimir Dronnikov ,\n* Pete Kruckenberg (),\n* Paul Chavard (),\n* Ed Finkler ()\n* Pavel Pravosud \n* Anton Lindqvist ()\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", "readmeFilename": "README.markdown", "_id": "underscore.string@2.2.1", - "_from": "underscore.string@>=2.2.1 <2.3.0" + "_from": "underscore.string@2.2.1" } diff --git a/node_modules/jsdoc/.jshintrc b/node_modules/jsdoc/.jshintrc deleted file mode 100644 index d2a4902..0000000 --- a/node_modules/jsdoc/.jshintrc +++ /dev/null @@ -1,60 +0,0 @@ -{ - "bitwise": true, - "curly": true, - "eqeqeq": false, - "forin": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": true, - "plusplus": false, - "regexp": false, - "undef": true, - "strict": false, - "trailing": false, - - "asi": false, - "boss": false, - "debug": false, - "eqnull": true, - "es5": true, - "esnext": true, - "evil": false, - "expr": false, - "funcscope": false, - "globalstrict": false, - "iterator": false, - "lastsemic": false, - "laxbreak": false, - "laxcomma": false, - "loopfunc": true, - "multistr": false, - "onecase": true, - "proto": false, - "regexdash": false, - "scripturl": true, - "shadow": false, - "smarttabs": false, - "sub": false, - "supernew": false, - "validthis": false, - - "browser": false, - "couch": false, - "devel": false, - "dojo": false, - "jquery": false, - "mootools": false, - "node": true, - "nonstandard": false, - "prototypejs": false, - "rhino": true, - "wsh": false, - - "nomen": false, - "onevar": false, - "passfail": false, - "white": false -} diff --git a/node_modules/jsdoc/.npmignore b/node_modules/jsdoc/.npmignore index 929e4af..aaa8ad0 100644 --- a/node_modules/jsdoc/.npmignore +++ b/node_modules/jsdoc/.npmignore @@ -1,6 +1,14 @@ -build-files/java/build -jsdoc.jar -test/tutorials/out -conf.json -out/ -.tern-port +# development-related files +.eslintignore +.eslintrc +.gitignore +.travis.yml +gulpfile.js + +# scripts for launching JSDoc with Mozilla Rhino +/jsdoc* +!/jsdoc.js + +# Rhino and test directories +rhino/ +test/ diff --git a/node_modules/jsdoc/.travis.yml b/node_modules/jsdoc/.travis.yml deleted file mode 100644 index 7a0275a..0000000 --- a/node_modules/jsdoc/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: java - -script: - - "./jsdoc -T" diff --git a/node_modules/jsdoc/CONTRIBUTING.md b/node_modules/jsdoc/CONTRIBUTING.md index 25f5a19..2ed1942 100644 --- a/node_modules/jsdoc/CONTRIBUTING.md +++ b/node_modules/jsdoc/CONTRIBUTING.md @@ -1,9 +1,9 @@ Pull Requests ------------- -If you're thinking about making some changes, maybe fixing a bug, or adding a -snazzy new feature, first, thank you. Contributions are very welcome. Things -need to be manageable for the maintainers, however. So below you'll find **The +If you're thinking about making some changes, maybe fixing a bug, or adding a +snazzy new feature, first, thank you. Contributions are very welcome. Things +need to be manageable for the maintainers, however. So below you'll find **The fastest way to get your pull request merged in.** Some things, particularly how you set up your branches and work with git, are just suggestions, but pretty good ones. @@ -11,34 +11,34 @@ ones. 1. **Create a remote to track the base jsdoc3/jsdoc repository** This is just a convenience to make it easier to update your `````` (more on that shortly). You would execute something like: - + git remote add base git://github.com/jsdoc3/jsdoc.git - - Here 'base' is the name of the remote. Feel free to use whatever you want. + + Here 'base' is the name of the remote. Feel free to use whatever you want. 2. **Set up a tracking branch for the base repository** We're gonna call this your ``````. You will only ever update this branch by pulling from the 'base' remote. (as opposed to 'origin') - + git branch --track pullpost base/master git checkout pullpost - + Here 'pullpost' is the name of the branch. Fell free to use whatever you want. - + 3. **Create your change branch** Once you are in ``````, make sure it's up to date, then create a branch for your changes off of that one. - + git branch fix-for-issue-395 git checkout fix-for-issue-395 - + Here 'fix-for-issue-395' is the name of the branch. Feel free to use whatever you want. We'll call this the ``````. This is the branch that you will eventually issue your pull request from. - + The purpose of these first three steps is to make sure that your merge request has a nice clean diff that only involves the changes related to your fix/feature. - + 4. **Make your changes** On your `````` make any changes relevant to your fix/feature. Don't group fixes for multiple unrelated issues or multiple unrelated features together. @@ -46,15 +46,12 @@ ones. fixing a bug in the parser and adding some new UI to the default template, those should be separate branches and merge requests. - Also, if you want to change `package.json`, note that you must make your changes - in `Jake/templates/package.json.tmpl`, then run `jake`. - 5. **Add tests** Add tests for your change. If you are submitting a bugfix, include a test that verifies the existence of the bug along with your fix. If you are submitting a new feature, include tests that verify proper feature function, if applicable. See the readme in the 'test' directory for more information - + 6. **Commit and publish** Commit your changes and publish your branch (or push it if it's already published) @@ -65,8 +62,8 @@ ones. situations that bug occurs in and a sense of it's severity. If it does already have an issue, make sure the include the hash and issue number (e.g. '#100') so github links it. - + If it's a feature, provide some context about the motivations behind the feature, - why it's important/useful/cool/necessary and what it does/how it works. Don't + why it's important/useful/cool/necessary and what it does/how it works. Don't worry about being too verbose. Folks will be much more amenable to reading through your code if they know what its supposed to be about. diff --git a/node_modules/jsdoc/Jake/lib/mustache.js b/node_modules/jsdoc/Jake/lib/mustache.js deleted file mode 100644 index 60687a3..0000000 --- a/node_modules/jsdoc/Jake/lib/mustache.js +++ /dev/null @@ -1,335 +0,0 @@ -/* - mustache.js — Logic-less templates in JavaScript - - See http://mustache.github.com/ for more info. -*/ - -var Mustache = function() { - var Renderer = function() {}; - - Renderer.prototype = { - otag: "{{", - ctag: "}}", - pragmas: {}, - buffer: [], - pragmas_implemented: { - "IMPLICIT-ITERATOR": true, - "ARRAY-ORDINALS": true // define #first? and #last? when looping arrays - }, - context: {}, - - render: function(template, context, partials, in_recursion) { - // reset buffer & set context - if(!in_recursion) { - this.context = context; - this.buffer = []; // TODO: make this non-lazy - } - - // fail fast - if(!this.includes("", template)) { - if(in_recursion) { - return template; - } else { - this.send(template); - return; - } - } - - template = this.render_pragmas(template); - var html = this.render_section(template, context, partials); - if(in_recursion) { - return this.render_tags(html, context, partials, in_recursion); - } - - this.render_tags(html, context, partials, in_recursion); - }, - - /* - Sends parsed lines - */ - send: function(line) { - if(line != "") { - this.buffer.push(line); - } - }, - - /* - Looks for %PRAGMAS - */ - render_pragmas: function(template) { - // no pragmas - if(!this.includes("%", template)) { - return template; - } - - var that = this; - var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" + - this.ctag); - return template.replace(regex, function(match, pragma, options) { - if(!that.pragmas_implemented[pragma]) { - throw({message: - "This implementation of mustache doesn't understand the '" + - pragma + "' pragma"}); - } - that.pragmas[pragma] = {}; - if(options) { - var opts = options.split("="); - that.pragmas[pragma][opts[0]] = opts[1]; - } - return ""; - // ignore unknown pragmas silently - }); - }, - - /* - Tries to find a partial in the curent scope and render it - */ - render_partial: function(name, context, partials) { - name = this.trim(name); - if(!partials || partials[name] === undefined) { - throw({message: "unknown_partial '" + name + "'"}); - } - if(typeof(context[name]) != "object") { - return this.render(partials[name], context, partials, true); - } - return this.render(partials[name], context[name], partials, true); - }, - - /* - Renders inverted (^) and normal (#) sections - */ - render_section: function(template, context, partials) { - if(!this.includes("#", template) && !this.includes("^", template)) { - return template; - } - - var that = this; - // CSW - Added "+?" so it finds the tighest bound, not the widest - var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag + - "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag + - "\\s*", "mg"); - - // for each {{#foo}}{{/foo}} section do... - return template.replace(regex, function(match, type, name, content) { - var value = that.find(name, context); - if(type == "^") { // inverted section - if(!value || that.is_array(value) && value.length === 0) { - // false or empty list, render it - return that.render(content, context, partials, true); - } else { - return ""; - } - } else if(type == "#") { // normal section - if(that.is_array(value)) { // Enumerable, Let's loop! - var len = value.length; - return value.map(function(row, i) { - return that.render(content, that.create_context(row, {first: i === 0, last: i === len-1}), - partials, true); - }).join(""); - } else if(that.is_object(value)) { // Object, Use it as subcontext! - return that.render(content, that.create_context(value), - partials, true); - } else if(typeof value === "function") { - // higher order section - return value.call(context, content, function(text) { - return that.render(text, context, partials, true); - }); - } else if(value) { // boolean section - return that.render(content, context, partials, true); - } else { - return ""; - } - } - }); - }, - - /* - Replace {{foo}} and friends with values from our view - */ - render_tags: function(template, context, partials, in_recursion) { - // tit for tat - var that = this; - - var new_regex = function() { - return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" + - that.ctag + "+", "g"); - }; - - var regex = new_regex(); - var tag_replace_callback = function(match, operator, name) { - switch(operator) { - case "!": // ignore comments - return ""; - case "=": // set new delimiters, rebuild the replace regexp - that.set_delimiters(name); - regex = new_regex(); - return ""; - case ">": // render partial - return that.render_partial(name, context, partials); - case "{": // the triple mustache is unescaped - return that.find(name, context); - default: // escape the value - return that.escape(that.find(name, context)); - } - }; - var lines = template.split("\n"); - for(var i = 0; i < lines.length; i++) { - lines[i] = lines[i].replace(regex, tag_replace_callback, this); - if(!in_recursion) { - this.send(lines[i]); - } - } - - if(in_recursion) { - return lines.join("\n"); - } - }, - - set_delimiters: function(delimiters) { - var dels = delimiters.split(" "); - this.otag = this.escape_regex(dels[0]); - this.ctag = this.escape_regex(dels[1]); - }, - - escape_regex: function(text) { - // thank you Simon Willison - if(!arguments.callee.sRE) { - var specials = [ - '/', '.', '*', '+', '?', '|', - '(', ')', '[', ']', '{', '}', '\\' - ]; - arguments.callee.sRE = new RegExp( - '(\\' + specials.join('|\\') + ')', 'g' - ); - } - return text.replace(arguments.callee.sRE, '\\$1'); - }, - - /* - find `name` in current `context`. That is find me a value - from the view object - */ - find: function(name, context) { - name = this.trim(name); - - // Checks whether a value is thruthy or false or 0 - function is_kinda_truthy(bool) { - return bool === false || bool === 0 || bool; - } - - var value; - if(is_kinda_truthy(context[name])) { - value = context[name]; - } else if(is_kinda_truthy(this.context[name])) { - value = this.context[name]; - } - - if(typeof value === "function") { - return value.apply(context); - } - if(value !== undefined) { - return value; - } - // silently ignore unkown variables - return ""; - }, - - // Utility methods - - /* includes tag */ - includes: function(needle, haystack) { - return haystack.indexOf(this.otag + needle) != -1; - }, - - /* - Does away with nasty characters - */ - escape: function(s) { - s = String(s === null ? "" : s); - return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) { - switch(s) { - case "&": return "&"; - case "\\": return "\\\\"; - case '"': return '"'; - case "'": return '''; - case "<": return "<"; - case ">": return ">"; - default: return s; - } - }); - }, - - // by @langalex, support for arrays of strings - create_context: function(_context, opts) { - if(this.is_object(_context)) { - if (this.pragmas["ARRAY-ORDINALS"] && opts) { - _context['first?'] = opts.first || false; - _context['last?'] = opts.last || false; - } - return _context; - } else { - var iterator = "."; - if(this.pragmas["IMPLICIT-ITERATOR"]) { - iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator; - } - var ctx = {}; - ctx[iterator] = _context; - if (this.pragmas["ARRAY-ORDINALS"] && opts){ - ctx['first?'] = opts.first || false; - ctx['last?'] = opts.last || false; - } - return ctx; - } - }, - - is_object: function(a) { - return a && typeof a == "object"; - }, - - is_array: function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }, - - /* - Gets rid of leading and trailing whitespace - */ - trim: function(s) { - return s.replace(/^\s*|\s*$/g, ""); - }, - - /* - Why, why, why? Because IE. Cry, cry cry. - */ - map: function(array, fn) { - if (typeof array.map == "function") { - return array.map(fn); - } else { - var r = []; - var l = array.length; - for(var i = 0; i < l; i++) { - r.push(fn(array[i])); - } - return r; - } - } - }; - - return({ - name: "mustache.js", - version: "0.3.1-dev", - - /* - Turns a template and view into HTML - */ - to_html: function(template, view, partials, send_fun) { - var renderer = new Renderer(); - if(send_fun) { - renderer.send = send_fun; - } - renderer.render(template, view, partials); - if(!send_fun) { - return renderer.buffer.join("\n"); - } - } - }); -}(); \ No newline at end of file diff --git a/node_modules/jsdoc/Jake/templates/package.json.tmpl b/node_modules/jsdoc/Jake/templates/package.json.tmpl deleted file mode 100644 index 0319ca2..0000000 --- a/node_modules/jsdoc/Jake/templates/package.json.tmpl +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "{{appname}}", - "version": "{{appversion}}", - "revision": "{{timestamp}}", - "description": "An API documentation generator for JavaScript.", - "keywords": [ "documentation", "javascript" ], - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/jsdoc3/jsdoc" - }, - "dependencies": { - "async": "0.1.22", - "catharsis": "0.7.0", - "crypto-browserify": "git+https://github.com/dominictarr/crypto-browserify.git#95c5d505", - "js2xmlparser": "0.1.0", - "jshint": "0.9.1", - "marked": "0.2.8", - "taffydb": "git+https://github.com/hegemonic/taffydb.git", - "underscore": "1.4.2", - "wrench": "1.3.9" - }, - "bin": "./nodejs/bin/jsdoc", - "bugs": "https://github.com/jsdoc3/jsdoc/issues", - "author": { - "name": "Michael Mathews", - "email": "micmath@gmail.com" - }, - "contributors": [ - { - "url": "https://github.com/jsdoc3/jsdoc/graphs/contributors" - } - ], - "maintainers": { - "name": "Jeff Williams", - "email": "jeffrey.l.williams@gmail.com" - } -} diff --git a/node_modules/jsdoc/Jakefile.js b/node_modules/jsdoc/Jakefile.js deleted file mode 100644 index 76547ba..0000000 --- a/node_modules/jsdoc/Jakefile.js +++ /dev/null @@ -1,82 +0,0 @@ -/*global desc: true, fail: true, Mustache: true, task: true */ -// see: https://github.com/mde/jake - -desc('Updating package.json revision.'); -task('default', [], function(params) { - /*jshint evil: true */ - var fs = require('fs'); - - // import the Mustache template tool - eval(fs.readFileSync('Jake/lib/mustache.js', 'utf8')); - - var templates = { - packagejson : fs.readFileSync('Jake/templates/package.json.tmpl', 'utf8') - }; - - var metadata = { - appname : 'jsdoc', - appversion : '3.2.2', - timestamp : '' + new Date().getTime() - }; - - var outdir = './'; - - var rendered = Mustache.to_html(templates.packagejson, metadata); - - fs.writeFileSync(outdir + 'package.json', rendered, 'utf8'); - - process.exit(0); - -}); - -desc('Installs a plugin/template.'); -task('install', [], function(loc) { - var fs = require('fs'), - util = require('util'), - path = require('path'), - wrench = require('wrench'); - - if(!loc) { - fail("You must specify the location of the plugin/template."); - } - - if(!fs.existsSync(loc)) { - fail("plugin/template location [" + loc + "] is not valid."); - } - - var pluginLoc = path.join(loc, "plugins"), - templateLoc = path.join(loc, "templates"), - jsdocLoc = process.cwd(), - name, - config; - - //First the plugin - if(fs.existsSync(pluginLoc)) { - //copy it over - wrench.copyDirSyncRecursive(pluginLoc, path.join(jsdocLoc, "plugins"), { - preserve : true - }); - //find out what it's called - name = fs.readdirSync(pluginLoc)[0].replace(".js", ""); - //And finally edit the conf.json - try { - config = JSON.parse(fs.readFileSync(path.join(jsdocLoc, 'conf.json'), 'utf8')); - if(config.plugins.indexOf('plugins/' + name) == -1) { - config.plugins.push('plugins/' + name); - fs.writeFileSync(path.join(jsdocLoc, 'conf.json'), JSON.stringify(config, null, " "), 'utf8'); - } - } catch (e) { - fail("Could not edit the conf.json file: " + e); - } - } - - //Then the template - if(fs.existsSync(templateLoc)) { - wrench.copyDirSyncRecursive(templateLoc, path.join(jsdocLoc, "templates"), { - preserve : true - }); - } - - process.exit(0); - -}); \ No newline at end of file diff --git a/node_modules/jsdoc/LICENSE.md b/node_modules/jsdoc/LICENSE.md index de2d049..051763a 100644 --- a/node_modules/jsdoc/LICENSE.md +++ b/node_modules/jsdoc/LICENSE.md @@ -4,7 +4,8 @@ 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-2012 Michael Mathews +Copyright (c) 2011-2014 Michael Mathews and the +[contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). All rights reserved. You may obtain a copy of the License at: @@ -20,12 +21,11 @@ As stated in Section 7, "Disclaimer of Warranty," of the License: > conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A > PARTICULAR PURPOSE. You are solely responsible for determining the > appropriateness of using or redistributing the Work and assume any risks -> associated with Your exercise of mpermissions under this License. +> associated with Your exercise of permissions under this License. The source code for JSDoc 3 is available at: https://github.com/jsdoc3/jsdoc - # Third-Party Software # JSDoc 3 includes or depends upon the following third-party software, either in @@ -55,6 +55,18 @@ license, which is reproduced below: > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > SOFTWARE. +## Acorn ## + +Portions of the Acorn source code are incorporated into the following files: + +- `lib/jsdoc/src/walker.js` + +Acorn is distributed under the MIT license, which is reproduced above. + +Copyright (C) 2012 Marijn Haverbeke . + +The source code for Acorn is available at: +https://github.com/marijnh/acorn ## Async.js ## @@ -65,7 +77,6 @@ Copyright (c) 2010 Caolan McMahon. The source code for Async.js is available at: https://github.com/caolan/async - ## Catharsis ## Catharsis is distributed under the MIT license, which is reproduced above. @@ -75,16 +86,44 @@ Copyright (c) 2012-2013 Jeff Williams. The source code for Catharsis is available at: https://github.com/hegemonic/catharsis - ## crypto-browserify ## -License information for crypto-browserify is not available. It is assumed that -the package is distributed under the MIT license or a similar open source -license. +crypto-browserify is distributed under the MIT license, which is reproduced +above. + +Copyright (c) 2013 Dominic Tarr. The source code for crypto-browserify is available at: https://github.com/dominictarr/crypto-browserify +## Esprima ## + +Esprima is distributed under the BSD 2-clause license: + +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> +> - Redistributions of source code must retain the above copyright notice, +> this list of conditions and the following disclaimer. +> - Redistributions in binary form must reproduce the above copyright notice, +> this list of conditions and the following disclaimer in the documentation +> and/or other materials provided with the distribution. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +> ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +> DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +> ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +> THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (c) 2011-2013 Ariya Hidayat and other Esprima contributors. + +The source code for Esprima is available at: +https://github.com/ariya/esprima ## github-flavored-markdown ## @@ -124,7 +163,6 @@ github-flavored-markdown is distributed under the BSD 3-clause license: The source code for github-flavored-markdown is available at: https://github.com/hegemonic/github-flavored-markdown - ## Google Code Prettify ## Google Code Prettify is distributed under the Apache License 2.0, which is @@ -135,7 +173,6 @@ Copyright (c) 2006 Google Inc. The source code for Google Code Prettify is available at: https://code.google.com/p/google-code-prettify/ - ## Jasmine ## Jasmine is distributed under the MIT license, which is reproduced above. @@ -145,7 +182,6 @@ Copyright (c) 2008-2011 Pivotal Labs. The source code for Jasmine is available at: https://github.com/pivotal/jasmine - ## jasmine-node ## jasmine-node is distributed under the MIT license, which is reproduced above. @@ -155,7 +191,6 @@ Copyright (c) 2010 Adam Abrons and Misko Hevery (http://getangular.com). The source code for jasmine-node is available at: https://github.com/mhevery/jasmine-node - ## js2xmlparser ## js2xmlparser is distributed under the MIT license, which is reproduced above. @@ -165,7 +200,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. @@ -198,7 +232,6 @@ modified MIT license: 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: @@ -215,6 +248,19 @@ Copyright Joyent, Inc. and other Node contributors. All rights reserved. The source code for Node.js is available at: https://github.com/joyent/node +## node-browser-builtins ## + +Portions of the node-browser-builtins source code are incorporated into the +following files: + +- `rhino/assert.js` +- `rhino/rhino-shim.js` + +node-browser-builtins is distributed under the MIT license, which is reproduced +above. + +The source code for node-browser-builtins is available at: +https://github.com/alexgorbatchev/node-browser-builtins ## node-browserify ## @@ -228,56 +274,23 @@ 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 +## Requizzle ## -## TaffyDB ## +Requizzle is distributed under the MIT license, which is reproduced above. -TaffyDB is distributed under a modified BSD license: - -> All rights reserved. -> -> Redistribution and use of this software in source and binary forms, with or -> without modification, are permitted provided that the following condition is -> met: -> -> Redistributions of source code must retain the above copyright notice, this -> list of conditions and the following disclaimer. -> -> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -> POSSIBILITY OF SUCH DAMAGE. - -The source code for TaffyDB is available at: -https://github.com/hegemonic/taffydb - - -## Tomorrow Theme for Google Code Prettify ## - -License information for the Tomorrow Theme for Google Code Prettify is not -available. It is assumed that the package is distributed under an open source -license that is compatible with the Apache License 2.0. - -Copyright (c) Yoshihide Jimbo. - -The source code for the Tomorrow Theme is available at: -https://github.com/jmblog/color-themes-for-google-code-prettify +Copyright (c) 2014 Google Inc. All rights reserved. +Copyright (c) 2012-2013 Johannes Ewald. +The source code for Requizzle is available at: +https://github.com/hegemonic/requizzle ## Rhino ## Rhino is distributed under the following licenses: -### MPL/GPL License ### -The majority of the source code for Rhino is available under a MPL 1.1/GPL 2.0 -license. JSDoc 3 uses the source code under the MPL 1.1 license, which is -included in this distribution. +### MPL 2.0 License ### +The majority of the source code for Rhino is available under the Mozilla Public +License (MPL) 2.0, which is included in this distribution. ### License for portions of the Rhino debugger ### Additionally, some files are available under the BSD 3-clause license: @@ -309,18 +322,64 @@ Additionally, some files are available under the BSD 3-clause license: ### Source Code ### The source code for Rhino is available at: -https://github.com/hegemonic/rhino +https://github.com/jsdoc3/rhino +## TaffyDB ## + +TaffyDB is distributed under a modified BSD license: + +> All rights reserved. +> +> Redistribution and use of this software in source and binary forms, with or +> without modification, are permitted provided that the following condition is +> met: +> +> Redistributions of source code must retain the above copyright notice, this +> list of conditions and the following disclaimer. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +> POSSIBILITY OF SUCH DAMAGE. + +The source code for TaffyDB is available at: +https://github.com/hegemonic/taffydb + +## Tomorrow Theme for Google Code Prettify ## + +License information for the Tomorrow Theme for Google Code Prettify is not +available. It is assumed that the package is distributed under an open source +license that is compatible with the Apache License 2.0. + +Copyright (c) Yoshihide Jimbo. + +The source code for the Tomorrow Theme is available at: +https://github.com/jmblog/color-themes-for-google-code-prettify + +## tv4 ## + +tv4 is in the public domain. It is also distributed under the MIT license, which +is reproduced above. + +The source code for tv4 is available at: +https://github.com/geraintluff/tv4 ## Underscore.js ## Underscore.js is distributed under the MIT license, which is reproduced above. -Copyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud. +Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors. The source code for Underscore.js is available at: -https://github.com/documentcloud/underscore - +https://github.com/jashkenas/underscore ## wrench-js ## diff --git a/node_modules/jsdoc/README.md b/node_modules/jsdoc/README.md index fb0bff7..bae6441 100644 --- a/node_modules/jsdoc/README.md +++ b/node_modules/jsdoc/README.md @@ -1,116 +1,132 @@ JSDoc 3 ======= -[![Build Status](https://secure.travis-ci.org/jsdoc3/jsdoc.png?branch=master)](http://travis-ci.org/jsdoc3/jsdoc) +[![Build Status](https://img.shields.io/travis/jsdoc3/jsdoc.svg)](http://travis-ci.org/jsdoc3/jsdoc) -An inline API documentation processor for JavaScript. JSDoc 3 is intended to be -an upgrade to JsDoc Toolkit (JSDoc 2). +An API documentation generator for JavaScript. Want to contribute to JSDoc? Please read `CONTRIBUTING.md`. +Installation and Usage +---------------------- -Installation ------------- +You can run JSDoc on either Node.js or Mozilla Rhino. -Use git to clone the [official JSDoc repository](https://github.com/jsdoc3/jsdoc): +### Node.js - git clone https://github.com/jsdoc3/jsdoc.git +Native support for Node.js is available in JSDoc 3.3.0 and later. JSDoc +supports Node.js 0.10 and later. -Alternatively, you can download a .zip file for the +#### Installing JSDoc for Node.js + +You can install JSDoc in your project's `node_modules` folder, or you can +install it globally. + +To install the latest alpha version: + + npm install jsdoc@"<=3.3.0" + +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 +`./node_modules/.bin`. To generate documentation for the file +`yourJavaScriptFile.js`: + + ./node_modules/.bin/jsdoc yourJavaScriptFile.js + +Or if you installed JSDoc globally, simply run the `jsdoc` command: + + jsdoc yourJavaScriptFile.js + +By default, the generated documentation is saved in a directory named `out`. You +can use the `--destination` (`-d`) option to specify another directory. + +Run `jsdoc --help` for a complete list of command-line options. + +### Mozilla Rhino + +All versions of JSDoc 3 run on a customized version of Mozilla Rhino, which +requires Java. You can run JSDoc 3 on Java 1.6 and later. + +#### Installing JSDoc for Mozilla Rhino + +To install JSDoc, download a .zip file for the [latest development version](https://github.com/jsdoc3/jsdoc/archive/master.zip) or a [previous release](https://github.com/jsdoc3/jsdoc/tags). -You can also install JSDoc within a Node.js project's `node_modules` directory -using npm. To install the latest development version, change directories to your -Node.js project, then run the following command: +You can also use git to clone the +[JSDoc repository](https://github.com/jsdoc3/jsdoc): - npm install git://github.com/jsdoc3/jsdoc.git + git clone git+https://github.com/jsdoc3/jsdoc.git -Or to install JSDoc globally: +The JSDoc repository includes a +[customized version of Mozilla Rhino](https://github.com/jsdoc3/rhino). Make +sure your Java classpath does not include any other versions of Rhino. (On OS X, +you may need to remove the file `~/Library/Java/Extensions/js.jar`.) - npm install -g git://github.com/jsdoc3/jsdoc.git +**Note**: In JSDoc 3.3.0 and later, if you need to run JSDoc on Mozilla Rhino, +do not install JSDoc with npm. Use one of the methods described above. -**Note**: Although you can install JSDoc with npm, JSDoc does not currently run -on Node.js. +#### Running JSDoc with Mozilla Rhino + +On OS X, Linux, and other POSIX systems, to generate documentation for the file +`yourJavaScriptFile.js`: + + ./jsdoc yourJavaScriptFile.js + +Or on Windows: + + jsdoc yourJavaScriptFile.js + +By default, the generated documentation is saved in a directory named `out`. You +can use the `--destination` (`-d`) option to specify another directory. + +Run `jsdoc --help` for a complete list of command-line options. -Usage ------ +Templates and Build Tools +------------------------- -This example assumes that your working directory is the JSDoc application base -directory: +The JSDoc community has created numerous templates and other tools to help you +generate and customize your documentation. Here are just a few: - ./jsdoc yourSourceCodeFile.js +### Templates -For information about the supported command-line options, use the `--help` -option. ++ [jaguarjs-jsdoc](https://github.com/davidshimjs/jaguarjs-jsdoc) + ([example](http://davidshimjs.github.io/jaguarjs/doc)) ++ [DocStrap](https://github.com/terryweiss/docstrap) ++ [jsdoc3Template](https://github.com/DBCDK/jsdoc3Template) + ([example](https://github.com/danyg/jsdoc3Template/wiki#wiki-screenshots)) - ./jsdoc --help +### Build Tools -Generated documentation will appear in the folder specified by the -`--destination` option, or in a folder named "out" by default. ++ [JSDoc Grunt plugin](https://github.com/krampstudio/grunt-jsdoc) ++ [JSDoc ant task](https://github.com/jannon/jsdoc3-ant-task) -Dependencies ------------- - -JSDoc 3 uses the Mozilla Rhino engine, which requires Java. JSDoc 3 is known to -work with version 1.6.0_24 of Java. - -JSDoc 3 uses advanced features in Mozilla Rhino that are only available in or -after version 1.7R3. In addition, JSDoc 3 requires several customizations to the -standard Rhino distribution. The customized version of Rhino is included with -JSDoc. - -In rare cases, users may have their Java CLASSPATH configured to override the -included Rhino and point to an older version of Rhino instead. If this is the -case, simply correct the CLASSPATH to remove the older Rhino. (On OS X, you may -need to remove the file `~/Library/Java/Extensions/js.jar`.) - -The version of Rhino distributed with JSDoc 3 can be found here: -https://github.com/hegemonic/rhino - - -Debugging ---------- - -Rhino is not always very friendly when it comes to reporting errors in -JavaScript. Luckily, it comes with a full-on debugger included that can be much -more useful than a simple stack trace. To invoke JSDoc with the debugger, run -the following command on Windows: - - jsdoc --debug - -Or on OS X, Linux, and other POSIX-compliant systems: - - ./jsdoc --debug - -If you can't get the short-form commands to work, try invoking Java directly: - - java -cp lib/js.jar org.mozilla.javascript.tools.debugger.Main \ - -debug -modules node_modules -modules rhino -modules lib -modules . \ - jsdoc.js your/script.js - -Note: `--debug` must be the first argument to the short-form command. - -This will open a debugging window. Click Debug > Break on Exceptions, then click -Run. If there is an error, you should see exactly where it is in the source -code. - - -See Also --------- - -Project Documentation: (under development) -Project Documentation Source: -JSDoc User's Group: -JSDoc 3 Ant Task: -Project Announcements: +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) ++ Post questions tagged `jsdoc` to [Stack +Overflow](http://stackoverflow.com/questions/tagged/jsdoc). License ------- -JSDoc 3 is copyright (c) 2011-2012 Michael Mathews . +JSDoc 3 is copyright (c) 2011-2014 Michael Mathews and the +[contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). JSDoc 3 is free software, licensed under the Apache License, Version 2.0. See the file `LICENSE.md` in this distribution for more details. diff --git a/node_modules/jsdoc/changes.md b/node_modules/jsdoc/changes.md index 792fa13..fc832d8 100644 --- a/node_modules/jsdoc/changes.md +++ b/node_modules/jsdoc/changes.md @@ -2,7 +2,6 @@ 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.2.2 (November 2013) ### Bug fixes @@ -13,7 +12,6 @@ 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 @@ -45,7 +43,6 @@ 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 @@ -76,7 +73,6 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + You can now use npm to install JSDoc globally by running `npm install -g`. **Note**: JSDoc will still run under Mozilla Rhino, not Node.js. (#374) + The `jsVersion` configuration property has been removed. (#390) - ### Bug fixes + JSDoc now quits if the configuration file cannot be loaded. (#407) + JSDoc's `--explain` (`-X`) option now runs much more quickly, and it outputs valid JSON to the console. (#298) @@ -105,7 +101,6 @@ 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) @@ -119,7 +114,6 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + `getSignatureTypes` + `linkto` - ## 3.1.0 (January 2013) ### Major changes @@ -224,7 +218,6 @@ 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 @@ -242,7 +235,6 @@ 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/grunt-jsdoc/node_modules/jsdoc/cli.js b/node_modules/jsdoc/cli.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/cli.js rename to node_modules/jsdoc/cli.js diff --git a/node_modules/jsdoc/jsdoc b/node_modules/jsdoc/jsdoc deleted file mode 100755 index 79714e1..0000000 --- a/node_modules/jsdoc/jsdoc +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -# rhino discards the path to the current script file, so we must add it back -SOURCE="$0" -while [ -h "$SOURCE" ] ; do - NEXTSOURCE="$(readlink "$SOURCE")" - echo $NEXTSOURCE | grep -q -e "^/" - if [ $? = 0 ]; then - SOURCE="$NEXTSOURCE" - else - SOURCE="$(dirname $SOURCE)/$NEXTSOURCE" - fi -done -# Get a Windows path under MinGW or Cygwin -BASEPATH="$( cd -P "$( dirname "$SOURCE" )" && (pwd -W 2>/dev/null || cygpath -w $(pwd) 2>/dev/null || pwd))" -if [ "${BASEPATH%${BASEPATH#?}}" != "/" ] ; then - BASEPATH="$( echo "$BASEPATH" | sed -e 's@\\@/@g' )" - # We need a extra slash for URLs - UBASEPATH="/$BASEPATH" -else - UBASEPATH="$BASEPATH" -fi - -# for whatever reason, Rhino requires module paths to be valid URIs -URLPATH="file://$UBASEPATH" -URLPATH=`echo "$URLPATH" | sed -e 's/ /%20/g'` -ENCODEDBASEPATH=`echo "$BASEPATH" | sed -e 's/ /%20/g'` - -if test "$1" = "--debug" -then - echo "Running Debug" - CMD="org.mozilla.javascript.tools.debugger.Main -debug -opt -1" - # strip --debug argument - shift -else - CMD="org.mozilla.javascript.tools.shell.Main" -fi - -#Conditionally execute different command lines depending on whether we're running tests or not -if test "$1" = "-T" -then - echo "Running Tests" - cd -P "$(dirname "$SOURCE")" - java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino" -modules "${URLPATH}/lib" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" "$@" --dirname="${BASEPATH}/" - -else - # normal mode should be quiet - java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino" -modules "${URLPATH}/lib" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" "$@" --dirname="${BASEPATH}/" -fi diff --git a/node_modules/jsdoc/jsdoc.cmd b/node_modules/jsdoc/jsdoc.cmd deleted file mode 100644 index f81212d..0000000 --- a/node_modules/jsdoc/jsdoc.cmd +++ /dev/null @@ -1,48 +0,0 @@ -@ECHO OFF - -SETLOCAL - -REM jsdoc.js expects Unix-style paths without a trailing slash -SET _BASEPATH=%~dp0 -SET _BASEPATH=%_BASEPATH:\=/% -SET _BASEPATH=%_BASEPATH:~0,-1% - -REM for whatever reason, Rhino requires module paths to be valid URIs -SET _URLPATH=file:/%_BASEPATH% - -REM we need the ability to resolve paths relative to the user's pwd -SET PWD=%cd% - -IF "%_URLPATH%"=="%_URLPATH: =%" GOTO NO_SPACES -:ESCAPE_SPACE -SET _TRAILING=%_URLPATH:* =% -CALL SET _URLPATH=%%_URLPATH: %_TRAILING%=%% -SET _URLPATH=%_URLPATH%%%20%_TRAILING% -IF NOT "%_URLPATH%"=="%_URLPATH: =%" GOTO ESCAPE_SPACE -:NO_SPACES - -IF [%1]==[--debug] ( - ECHO Running Debug - SET CMD=org.mozilla.javascript.tools.debugger.Main -debug -opt -1 - - REM `SHIFT` doesn't affect %* - :COLLECT_ARGS - IF [%2]==[] GOTO LAST_ARG - SET ARGS=%ARGS% %2 - SHIFT - GOTO COLLECT_ARGS -) ELSE ( - SET CMD=org.mozilla.javascript.tools.shell.Main - SET ARGS=%* -) -:LAST_ARG - -IF [%1]==[-T] ( - ECHO Running Tests - java -classpath "%_BASEPATH%/rhino/js.jar" %CMD% -opt -1 -modules "%_URLPATH%/node_modules" -modules "%_URLPATH%/rhino" -modules "%_URLPATH%/lib" -modules "%_URLPATH%" "%_BASEPATH%/jsdoc.js" %ARGS% --nocolor --dirname="%_BASEPATH%/ -) ELSE ( - REM normal mode should be quiet - java -classpath "%_BASEPATH%/rhino/js.jar" %CMD% -modules "%_URLPATH%/node_modules" -modules "%_URLPATH%/rhino" -modules "%_URLPATH%/lib" -modules "%_URLPATH%" "%_BASEPATH%/jsdoc.js" %ARGS% --dirname="%_BASEPATH%/ -) - -ENDLOCAL diff --git a/node_modules/jsdoc/jsdoc.js b/node_modules/jsdoc/jsdoc.js old mode 100644 new mode 100755 index 6312f1c..5ea476d --- a/node_modules/jsdoc/jsdoc.js +++ b/node_modules/jsdoc/jsdoc.js @@ -1,24 +1,21 @@ -/*global app: true, args: true, env: true, publish: true */ +#!/usr/bin/env node +/*global arguments, require: true */ /** * @project jsdoc * @author Michael Mathews * @license See LICENSE.md file included in this distribution. */ -// try: $ java -classpath build-files/java/classes/js.jar org.mozilla.javascript.tools.shell.Main main.js `pwd` script/to/parse.js - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - /** * Data representing the environment in which this app is running. * * @namespace * @name env */ -require('lib/jsdoc/util/global').env = { +global.env = { /** * Running start and finish times. - * + * * @memberof env */ run: { @@ -36,7 +33,7 @@ require('lib/jsdoc/util/global').env = { /** * The parsed JSON data from the configuration file. - * + * * @type Object * @memberof env */ @@ -44,20 +41,28 @@ require('lib/jsdoc/util/global').env = { /** * The absolute path to the base directory of the JSDoc application. - * + * * @private - * @deprecated Use `__dirname` instead. * @type string * @memberof env */ dirname: '.', /** - * The command-line arguments, parsed into a key/value hash. - * + * The user's working directory at the time that JSDoc was started. + * + * @private + * @type string + * @memberof env + */ + pwd: null, + + /** + * The command-line options, parsed into a key/value hash. + * * @type Object * @memberof env - * @example if (env.opts.help) { console.log('Helpful message.'); } + * @example if (global.env.opts.help) { console.log('Helpful message.'); } */ opts: {}, @@ -67,10 +72,10 @@ require('lib/jsdoc/util/global').env = { * @memberof env */ sourceFiles: [], - + /** * The JSDoc version number and revision date. - * + * * @type Object * @memberof env */ @@ -79,240 +84,101 @@ require('lib/jsdoc/util/global').env = { // initialize the environment for the current JavaScript VM (function(args) { - var vm = require('jsdoc/util/vm').vm; - // TODO: may need to move this file to support Node.js - require('initialize')[vm](args); -})( Array.prototype.slice.call(arguments, 0) ); + 'use strict'; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + var path; + + if (args[0] && typeof args[0] === 'object') { + // we should be on Node.js + args = [__dirname, process.cwd()]; + path = require('path'); + + // Create a custom require method that adds `lib/jsdoc` and `node_modules` to the module + // lookup path. This makes it possible to `require('jsdoc/foo')` from external templates and + // plugins, and within JSDoc itself. It also allows external templates and plugins to + // require JSDoc's module dependencies without installing them locally. + require = require('requizzle')({ + requirePaths: { + before: [path.join(__dirname, 'lib')], + after: [path.join(__dirname, 'node_modules')] + }, + infect: true + }); + } + + require('./lib/jsdoc/util/runtime').initialize(args); +})( Array.prototype.slice.call(arguments, 0) ); /** * Data that must be shared across the entire application. + * * @namespace * @name app */ -require('lib/jsdoc/util/global').app = { +global.app = { jsdoc: { - scanner: new (require('jsdoc/src/scanner').Scanner)(), - parser: new (require('jsdoc/src/parser').Parser)(), - name: require('jsdoc/name') + name: require('./lib/jsdoc/name'), + parser: null, + scanner: new (require('./lib/jsdoc/src/scanner').Scanner)() } }; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - /** - Try to recursively print out all key/values in an object. - @global - @private - @param {Object} ... Object/s to dump out to console. + * Recursively print an object's properties to stdout. This method is safe to use with objects that + * contain circular references. In addition, on Mozilla Rhino, this method is safe to use with + * native Java objects. + * + * @global + * @name dump + * @private + * @param {Object} obj - Object(s) to print to stdout. */ -function dump() { - var doop = require('jsdoc/util/doop').doop; - var _dump = require('jsdoc/util/dumper').dump; +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])) ); } -} +}; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// +(function() { + 'use strict'; -/** - * Run the jsdoc application. - * @todo Refactor function (and require statements) into smaller functions - */ -function main() { - var _ = require('underscore'); - var fs = require('jsdoc/fs'); - var path = require('jsdoc/path'); - var taffy = require('taffydb').taffy; + var logger = require('./lib/jsdoc/util/logger'); + var runtime = require('./lib/jsdoc/util/runtime'); + var cli = require('./cli'); - var jsdoc = { - augment: require('jsdoc/augment'), - borrow: require('jsdoc/borrow'), - Config: require('jsdoc/config'), - opts: { - args: require('jsdoc/opts/args') - }, - 'package': require('jsdoc/package'), - plugins: require('jsdoc/plugins'), - Readme: require('jsdoc/readme'), - src: { - filter: require('jsdoc/src/filter'), - handlers: require('jsdoc/src/handlers') - }, - tutorial: { - resolver: require('jsdoc/tutorial/resolver') - }, - util: { - include: require('jsdoc/util/include') - } - }; - - var confPath; - var defaultOpts; - var docs; - var filter; - var i; - var info; - var l; - var packageDocs; - var packageJson; - var sourceFiles; - var template; - - - defaultOpts = { - destination: './out/', - encoding: 'utf8' - }; - - // get JSDoc version number - info = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')); - env.version = { - number: info.version, - revision: new Date(parseInt(info.revision, 10)).toUTCString() - }; - - env.opts = jsdoc.opts.args.parse(env.args); - - confPath = env.opts.configure || path.join(__dirname, 'conf.json'); - if ( !fs.statSync(confPath).isFile() && !env.opts.configure ) { - confPath = path.join(__dirname, 'conf.json.EXAMPLE'); + function cb(errorCode) { + cli.logFinish(); + cli.exit(errorCode || 0); } - try { - env.conf = new jsdoc.Config( fs.readFileSync(confPath, 'utf8') ) - .get(); - } - catch (e) { - throw new Error('Cannot parse the config file ' + confPath + ': ' + e); + cli.setVersionInfo() + .loadConfig(); + + if (!global.env.opts.test) { + cli.configureLogger(); } - // look for options on the command line, in the config file, and in the defaults, in that order - env.opts = _.defaults(env.opts, env.conf.opts, defaultOpts); - - if (env.opts.help) { - console.log( jsdoc.opts.args.help() ); - process.exit(0); - } else if (env.opts.test) { - jsdoc.util.include('test/runner.js'); - process.exit(0); - } else if (env.opts.version) { - console.log('JSDoc ' + env.version.number + ' (' + env.version.revision + ')'); - process.exit(0); - } - - if (env.conf.plugins) { - jsdoc.plugins.installPlugins(env.conf.plugins, app.jsdoc.parser); - } - - if (env.conf.source && env.conf.source.include) { - env.opts._ = (env.opts._ || []).concat(env.conf.source.include); - } - - // any source file named package.json or README.md is treated special - for (i = 0, l = env.opts._.length; i < l; i++ ) { - if (/\bpackage\.json$/i.test(env.opts._[i])) { - packageJson = fs.readFileSync( env.opts._[i], 'utf8' ); - env.opts._.splice(i--, 1); - } - - if (/(\bREADME|\.md)$/i.test(env.opts._[i])) { - env.opts.readme = new jsdoc.Readme(env.opts._[i]).html; - env.opts._.splice(i--, 1); - } - } - - if (env.conf.source && env.opts._.length > 0) { // are there any files to scan and parse? - filter = new jsdoc.src.filter.Filter(env.conf.source); - - env.sourceFiles = sourceFiles = app.jsdoc.scanner.scan(env.opts._, - (env.opts.recurse? 10 : undefined), filter); - - jsdoc.src.handlers.attachTo(app.jsdoc.parser); - - docs = app.jsdoc.parser.parse(sourceFiles, env.opts.encoding); - - //The files are ALWAYS useful for the templates to have - //If there is no package.json, just create an empty package - packageDocs = new jsdoc.package.Package(packageJson); - packageDocs.files = sourceFiles || []; - docs.push(packageDocs); - - jsdoc.borrow.indexAll(docs); - - jsdoc.augment.addInherited(docs); - jsdoc.borrow.resolveBorrows(docs); - - app.jsdoc.parser.fireProcessingComplete(docs); - - if (env.opts.explain) { - dump(docs); - process.exit(0); - } - - if (env.opts.tutorials) { - jsdoc.tutorial.resolver.load(env.opts.tutorials); - jsdoc.tutorial.resolver.resolve(); - } - - env.opts.template = (function() { - var publish = env.opts.template || 'templates/default'; - // if we don't find it, keep the user-specified value so the error message is useful - return path.getResourcePath(publish) || env.opts.template; - })(); + cli.logStart(); + // On Rhino, we use a try/catch block so we can log the Java exception (if available) + if ( runtime.isRhino() ) { try { - template = require(env.opts.template + '/publish'); + cli.runCommand(cb); } catch(e) { - throw new Error('Unable to load template: ' + e.message || e); - } - - // templates should include a publish.js file that exports a "publish" function - if (template.publish && typeof template.publish === 'function') { - // convert this from a URI back to a path if necessary - env.opts.template = path._uriToPath(env.opts.template); - template.publish( - taffy(docs), - env.opts, - jsdoc.tutorial.resolver.root - ); - } - else { - // old templates define a global "publish" function, which is deprecated - jsdoc.util.include(env.opts.template + '/publish.js'); - if (publish && typeof publish === 'function') { - console.log( env.opts.template + ' uses a global "publish" function, which is ' + - 'deprecated and may not be supported in future versions. ' + - 'Please update the template to use "exports.publish" instead.' ); - // convert this from a URI back to a path if necessary - env.opts.template = path._uriToPath(env.opts.template); - publish( - taffy(docs), - env.opts, - jsdoc.tutorial.resolver.root - ); - } - else { - throw new Error( env.opts.template + ' does not export a "publish" function.' ); + if (e.rhinoException) { + logger.fatal( e.rhinoException.printStackTrace() ); + } else { + console.trace(e); + cli.exit(1); } } } -} - -try { - main(); - env.run.finish = new Date(); - process.exit(0); -} -catch(e) { - env.run.finish = new Date(); - if (e.rhinoException != null) { - e.rhinoException.printStackTrace(); - process.exit(1); - } else { - throw e; + else { + cli.runCommand(cb); } -} +})(); diff --git a/node_modules/jsdoc/lib/initialize.js b/node_modules/jsdoc/lib/initialize.js deleted file mode 100644 index 774b9d7..0000000 --- a/node_modules/jsdoc/lib/initialize.js +++ /dev/null @@ -1,40 +0,0 @@ -/*global env: true */ -exports.rhino = function(args) { - var myGlobal = require('jsdoc/util/global'); - - // note: mutates args - function getDirname() { - var dirname; - - // Rhino has no native way to get the base dirname of the current script, - // so this information must be manually passed in from the command line. - for (var i = 0; i < args.length; i++) { - if ( /^--dirname(?:=(.+?)(\/|\/\.)?)?$/i.test(args[i]) ) { - if (RegExp.$1) { - dirname = RegExp.$1; // last wins - args.splice(i--, 1); // remove --dirname opt from arguments - } - else { - dirname = args[i + 1]; - args.splice(i--, 2); - } - } - } - - return dirname; - } - - myGlobal.__dirname = env.dirname = getDirname(); - env.args = args; - - require('jsdoc/util/include')(__dirname + '/rhino/rhino-shim.js'); -}; - -exports.nodejs = function(args) { - throw new Error('Node.js is not currently supported!'); - /* - env.dirname = __dirname; - env.args = args; - // TODO: add lib/ to the library paths - */ -}; diff --git a/node_modules/jsdoc/lib/jsdoc/augment.js b/node_modules/jsdoc/lib/jsdoc/augment.js index 614fd31..7a3778f 100644 --- a/node_modules/jsdoc/lib/jsdoc/augment.js +++ b/node_modules/jsdoc/lib/jsdoc/augment.js @@ -1,3 +1,5 @@ +'use strict'; + var hasOwnProp = Object.prototype.hasOwnProperty; function mapDependencies(index) { @@ -7,7 +9,7 @@ function mapDependencies(index) { doclets = index[name]; for (var i = 0, ii = doclets.length; i < ii; ++i) { doc = doclets[i]; - if (doc.kind === "class" || doc.kind === "external") { + if (doc.kind === 'class' || doc.kind === 'external') { dependencies[name] = {}; len = doc.augments && doc.augments.length || 0; for (var j = 0; j < len; ++j) { @@ -31,11 +33,11 @@ Sorter.prototype.visit = function(key) { if (!(key in this.visited)) { this.visited[key] = true; - + if (this.dependencies[key]) { Object.keys(this.dependencies[key]).forEach(function(path) { self.visit(path); - }); + }); } this.sorted.push(key); @@ -61,7 +63,7 @@ function getMembers(longname, docs) { var candidate, members = []; for (var i = 0, ii = docs.length; i < ii; ++i) { candidate = docs[i]; - if (candidate.memberof === longname && candidate.scope === "instance") { + if (candidate.memberof === longname && candidate.scope === 'instance') { members.push(candidate); } } @@ -69,7 +71,7 @@ function getMembers(longname, docs) { } function getAdditions(doclets, docs, longnames) { - var doop = require("jsdoc/util/doop").doop; + var doop = require('jsdoc/util/doop'); var additions = []; var doc; @@ -84,7 +86,7 @@ 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") { + if (parents && doc.kind === 'class') { for (var j = 0, jj = parents.length; j < jj; j++) { members = getMembers(parents[j], docs); for (var k = 0, kk = members.length; k < kk; k++) { @@ -97,9 +99,9 @@ function getAdditions(doclets, docs, longnames) { member.inherited = true; member.memberof = doc.longname; - parts = member.longname.split("#"); + parts = member.longname.split('#'); parts[0] = doc.longname; - member.longname = parts.join("#"); + member.longname = parts.join('#'); // if the child doesn't override the parent member, add the parent member if (longnames.indexOf(member.longname) === -1) { diff --git a/node_modules/jsdoc/lib/jsdoc/borrow.js b/node_modules/jsdoc/lib/jsdoc/borrow.js index 5cc13ca..6f93ea9 100644 --- a/node_modules/jsdoc/lib/jsdoc/borrow.js +++ b/node_modules/jsdoc/lib/jsdoc/borrow.js @@ -2,10 +2,12 @@ A collection of functions relating to resolving @borrows tags in JSDoc symbols. @module jsdoc/borrow @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; -var doop = require("jsdoc/util/doop").doop; +var doop = require('jsdoc/util/doop'); +var logger = require('jsdoc/util/logger'); var hasOwnProp = Object.prototype.hasOwnProperty; @@ -29,36 +31,39 @@ exports.indexAll = function(docs) { deleting the "borrowed" array. */ exports.resolveBorrows = function(docs) { + /*eslint max-nested-callbacks:[2, 3] */ if (!docs.index) { - throw 'Docs has not been indexed: docs.index must be defined here.'; + 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; - + if (lent) { var cloned = doop(lent); 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; + clone.longname = clone.memberof + (clone.scope === 'instance' ? '#' : '.') + + clone.name; docs.push(clone); }); - + } }); - + delete doc.borrowed; } }); diff --git a/node_modules/jsdoc/lib/jsdoc/config.js b/node_modules/jsdoc/lib/jsdoc/config.js index 01edc2c..6e95bfd 100644 --- a/node_modules/jsdoc/lib/jsdoc/config.js +++ b/node_modules/jsdoc/lib/jsdoc/config.js @@ -1,12 +1,13 @@ /** @overview @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ /** - @module jsdoc/config + @module jsdoc/config */ +'use strict'; function mergeRecurse(target, source) { Object.keys(source).forEach(function(p) { @@ -18,24 +19,24 @@ function mergeRecurse(target, source) { target[p] = source[p]; } }); - + return target; } // required config values, override these defaults in your config.json if necessary -const defaults = { - "tags": { - "allowUnknownTags": true +var defaults = { + tags: { + allowUnknownTags: true }, - "templates": { - "monospaceLinks": false, - "cleverLinks": false + templates: { + monospaceLinks: false, + cleverLinks: false }, - "source": { - "includePattern": ".+\\.js(doc)?$", - "excludePattern": "(^|\\/|\\\\)_" + source: { + includePattern: '.+\\.js(doc)?$', + excludePattern: '' }, - "plugins": [] + plugins: [] }; /** @@ -44,7 +45,7 @@ const defaults = { @param {string} [json] - The contents of config.json. */ function Config(json) { - json = JSON.parse( (json || "{}") ); + json = JSON.parse( (json || '{}') ); this._config = mergeRecurse(defaults, json); } diff --git a/node_modules/jsdoc/lib/jsdoc/doclet.js b/node_modules/jsdoc/lib/jsdoc/doclet.js index 47f833c..deb2d2e 100644 --- a/node_modules/jsdoc/lib/jsdoc/doclet.js +++ b/node_modules/jsdoc/lib/jsdoc/doclet.js @@ -1,52 +1,66 @@ /** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + * @overview + * @author Michael Mathews + * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ /** - @module jsdoc/doclet - @requires jsdoc/tag - @requires jsdoc/name - @requires jsdoc/tag/dictionary + * @module jsdoc/doclet */ +'use strict'; +var _ = require('underscore'); var jsdoc = { + name: require('jsdoc/name'), + src: { + astnode: require('jsdoc/src/astnode'), + Syntax: require('jsdoc/src/syntax').Syntax + }, tag: { Tag: require('jsdoc/tag').Tag, dictionary: require('jsdoc/tag/dictionary') }, - name: require('jsdoc/name') + util: { + doop: require('jsdoc/util/doop') + } }; -var path = require('path'); +var path = require('jsdoc/path'); +var Syntax = jsdoc.src.Syntax; +var util = require('util'); - -function applyTag(tag) { +function applyTag(doclet, tag) { if (tag.title === 'name') { - this.name = tag.value; + doclet.name = tag.value; } if (tag.title === 'kind') { - this.kind = tag.value; + doclet.kind = tag.value; } if (tag.title === 'description') { - this.description = tag.value; - } - - if (tag.title === 'scope') { - this.scope = tag.value; + doclet.description = tag.value; } } // use the meta info about the source code to guess what the doclet kind should be -function codetypeToKind(type) { - var kind = (type || '').toLowerCase(); - - if (kind !== 'function') { - return 'member'; +function codeToKind(code) { + var parent; + + var isFunction = jsdoc.src.astnode.isFunction; + + // default + var kind = 'member'; + + if (code.type === Syntax.FunctionDeclaration || code.type === Syntax.FunctionExpression) { + kind = 'function'; } - + else if (code.node && code.node.parent) { + parent = code.node.parent; + if ( isFunction(parent) ) { + kind = 'param'; + } + } + return kind; } @@ -59,7 +73,7 @@ function unwrap(docletSrc) { // use the /m flag on regex to avoid having to guess what this platform's newline is docletSrc = docletSrc.replace(/^\/\*\*+/, '') // remove opening slash+stars - .replace(/\**\*\/$/, "\\Z") // replace closing star slash with end-marker + .replace(/\**\*\/$/, '\\Z') // replace closing star slash with end-marker .replace(/^\s*(\* ?|\\Z)/gm, '') // remove left margin like: spaces+star or spaces+end-marker .replace(/\s*\\Z$/g, ''); // remove end-marker @@ -67,51 +81,51 @@ function unwrap(docletSrc) { } function split(docletSrc) { - var tagSrcs = [], - tagText, - tagTitle; - + var tagSrcs = []; + // 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 - .forEach(function($) { - if ($) { - var parsedTag = $.match(/^(\S+)(:?\s+(\S[\s\S]*))?/); - - if (parsedTag) { - // we don't need parsedTag[0] - tagTitle = parsedTag[1]; - tagText = parsedTag[2]; + .replace(/^(\s*)@(\S)/gm, '$1\\@$2') // replace splitter ats with an arbitrary sequence + .split('\\@') // then split on that arbitrary sequence + .forEach(function($) { + var parsedTag; + var tagText; + var tagTitle; - if (tagTitle) { - tagSrcs.push({ - title: tagTitle, - text: tagText - }); + if ($) { + 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({ + title: tagTitle, + text: tagText + }); + } } } - } }); - + return tagSrcs; } /** - Convert the raw source of the doclet comment into an array of Tag objects. - @private + * Convert the raw source of the doclet comment into an array of Tag objects. + * @private */ function toTags(docletSrc) { - var tagSrcs, - tags = []; - - tagSrcs = split(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} ); + tags.push({ title: tagSrcs[i].title, text: tagSrcs[i].text }); } - + return tags; } @@ -123,51 +137,56 @@ function fixDescription(docletSrc) { } /** - @class - @classdesc Represents a single JSDoc comment. - @param {string} docletSrc - The raw source code of the jsdoc comment. - @param {object=} meta - Properties describing the code related to this comment. + * @class + * @classdesc Represents a single JSDoc comment. + * @param {string} docletSrc - The raw source code of the jsdoc comment. + * @param {object=} meta - Properties describing the code related to this comment. */ -exports.Doclet = function(docletSrc, meta) { +var Doclet = exports.Doclet = function(docletSrc, meta) { var newTags = []; /** The original text of the comment from the source code. */ this.comment = docletSrc; this.setMeta(meta); - + docletSrc = unwrap(docletSrc); docletSrc = fixDescription(docletSrc); newTags = toTags.call(this, docletSrc); - for (var i = 0, leni = newTags.length; i < leni; i++) { + for (var i = 0, l = newTags.length; i < l; i++) { this.addTag(newTags[i].title, newTags[i].text); } - + this.postProcess(); }; /** Called once after all tags have been added. */ -exports.Doclet.prototype.postProcess = function() { - if (!this.preserveName) { jsdoc.name.resolve(this); } +Doclet.prototype.postProcess = function() { + var i; + var l; + + if (!this.preserveName) { + jsdoc.name.resolve(this); + } if (this.name && !this.longname) { this.setLongname(this.name); } if (this.memberof === '') { - delete(this.memberof); + delete this.memberof; } - + if (!this.kind && this.meta && this.meta.code) { - this.addTag( 'kind', codetypeToKind(this.meta.code.type) ); + this.addTag( 'kind', codeToKind(this.meta.code) ); } - + if (this.variation && this.longname && !/\)$/.test(this.longname) ) { - this.longname += '('+this.variation+')'; + this.longname += '(' + this.variation + ')'; } - + // add in any missing param names if (this.params && this.meta && this.meta.code && this.meta.code.paramnames) { - for (var i = 0, len = this.params.length; i < len; i++) { + for (i = 0, l = this.params.length; i < l; i++) { if (!this.params[i].name) { this.params[i].name = this.meta.code.paramnames[i] || ''; } @@ -175,128 +194,183 @@ exports.Doclet.prototype.postProcess = function() { } }; -/** Add a tag to this doclet. - @param {string} title - The title of the tag being added. - @param {string} [text] - The text of the tag being added. -*/ -exports.Doclet.prototype.addTag = function(title, text) { +/** + * Add a tag to the doclet. + * + * @param {string} title - The title of the tag being added. + * @param {string} [text] - The text of the tag being added. + */ +Doclet.prototype.addTag = function(title, text) { var tagDef = jsdoc.tag.dictionary.lookUp(title), newTag = new jsdoc.tag.Tag(title, text, this.meta); if (tagDef && tagDef.onTagged) { tagDef.onTagged(this, newTag); } - + if (!tagDef) { this.tags = this.tags || []; this.tags.push(newTag); } - - applyTag.call(this, newTag); + + applyTag(this, newTag); }; -/** Set the `memberof` property of this doclet. - @param {string} sid - The longname of the symbol that this doclet is a member of. -*/ -exports.Doclet.prototype.setMemberof = function(sid) { - if (/^\.?/.test(sid)) { sid = sid.replace(/^.?/, ''); } +function removeGlobal(longname) { + var globalRegexp = new RegExp('^' + jsdoc.name.GLOBAL_LONGNAME + '\\.?'); + + return longname.replace(globalRegexp, ''); +} + +/** + * Set the doclet's `memberof` property. + * + * @param {string} sid - The longname of the doclet's parent symbol. + */ +Doclet.prototype.setMemberof = function(sid) { /** - The longname of the symbol that contains this one, if any. - @type string + * The longname of the symbol that contains this one, if any. + * @type string */ - this.memberof = sid.replace(/\.prototype/g, '#'); + this.memberof = removeGlobal(sid) + .replace(/\.prototype/g, jsdoc.name.INSTANCE); }; -/** Set the `longname` property of this doclet. - @param {string} name -*/ -exports.Doclet.prototype.setLongname = function(name) { - if (/^\.?/.test(name)) { name = name.replace(/^\.?/, ''); } - +/** + * Set the doclet's `longname` property. + * + * @param {string} name - The longname for the doclet. + */ +Doclet.prototype.setLongname = function(name) { /** - The fully resolved symbol name. - @type string + * The fully resolved symbol name. + * @type string */ - this.longname = name; + this.longname = removeGlobal(name); if (jsdoc.tag.dictionary.isNamespace(this.kind)) { this.longname = jsdoc.name.applyNamespace(this.longname, this.kind); } }; -/** Add a symbol to this doclet's `borrowed` array. - @param {string} source - The longname of the symbol that is the source. - @param {string} target - The name the symbol is being assigned to. -*/ -exports.Doclet.prototype.borrow = function(source, target) { - var about = {from: source}; - if (target) { about.as = target; } - +/** + * Get the full path to the source file that is associated with a doclet. + * + * @private + * @param {module:jsdoc/doclet.Doclet} The doclet to check for a filepath. + * @return {string} The path to the doclet's source file, or an empty string if the path is not + * available. + */ +function getFilepath(doclet) { + if (!doclet || !doclet.meta || !doclet.meta.filename) { + return ''; + } + + return path.join(doclet.meta.path || '', doclet.meta.filename); +} + +/** + * Set the doclet's `scope` property. Must correspond to a scope name that is defined in + * {@link module:jsdoc/name.SCOPE_NAMES}. + * + * @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); + + 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); + if (filepath) { + errorMessage += util.format(' (Source file: %s)', filepath); + } + + throw new Error(errorMessage); + } + + this.scope = scope; +}; + +/** + * Add a symbol to this doclet's `borrowed` array. + * + * @param {string} source - The longname of the symbol that is the source. + * @param {string} target - The name the symbol is being assigned to. + */ +Doclet.prototype.borrow = function(source, target) { + var about = { from: source }; + if (target) { + about.as = target; + } + if (!this.borrowed) { /** - A list of symbols that are borrowed by this one, if any. - @type Array. + * A list of symbols that are borrowed by this one, if any. + * @type Array. */ this.borrowed = []; } this.borrowed.push(about); }; -exports.Doclet.prototype.mix = function(source) { - if (!this.mixes) { - /** - A list of symbols that are mixed into this one, if any. - @type Array. - */ - this.mixes = []; - } +Doclet.prototype.mix = function(source) { + /** + * A list of symbols that are mixed into this one, if any. + * @type Array. + */ + this.mixes = this.mixes || []; this.mixes.push(source); }; -/** Add a symbol to this doclet's `augments` array. - @param {string} base - The longname of the base symbol. -*/ -exports.Doclet.prototype.augment = function(base) { - if (!this.augments) { - /** - A list of symbols that are augmented by this one, if any. - @type Array. - */ - this.augments = []; - } +/** + * Add a symbol to the doclet's `augments` array. + * + * @param {string} base - The longname of the base symbol. + */ +Doclet.prototype.augment = function(base) { + /** + * A list of symbols that are augmented by this one, if any. + * @type Array. + */ + this.augments = this.augments || []; this.augments.push(base); }; /** - Set the `meta` property of this doclet. - @param {object} meta -*/ -exports.Doclet.prototype.setMeta = function(meta) { - if (!this.meta) { - /** - Information about the source code associated with this doclet. - @namespace - */ - this.meta = {}; - } - + * Set the `meta` property of this doclet. + * + * @param {object} meta + */ +Doclet.prototype.setMeta = function(meta) { + /** + * Information about the source code associated with this doclet. + * @namespace + */ + this.meta = this.meta || {}; + if (meta.range) { /** - The positions of the first and last characters of the code associated with this doclet. - @type Array. + * The positions of the first and last characters of the code associated with this doclet. + * @type Array. */ this.meta.range = meta.range.slice(0); } if (meta.lineno) { /** - The name of the file containing the code associated with this doclet. - @type string + * The name of the file containing the code associated with this doclet. + * @type string */ this.meta.filename = path.basename(meta.filename); /** - The line number of the code associated with this doclet. - @type number - */ + * The line number of the code associated with this doclet. + * @type number + */ this.meta.lineno = meta.lineno; var pathname = path.dirname(meta.filename); @@ -304,12 +378,12 @@ exports.Doclet.prototype.setMeta = function(meta) { this.meta.path = pathname; } } - + /** - Information about the code symbol. - @namespace + * Information about the code symbol. + * @namespace */ - this.meta.code = (this.meta.code || {}); + this.meta.code = this.meta.code || {}; if (meta.id) { this.meta.code.id = meta.id; } if (meta.code) { if (meta.code.name) { @@ -320,8 +394,13 @@ exports.Doclet.prototype.setMeta = function(meta) { /** The type of the symbol in the source code. */ this.meta.code.type = meta.code.type; } + // the AST node is only enumerable in debug mode, which reduces clutter for the + // --explain/-X option if (meta.code.node) { - this.meta.code.node = meta.code.node; + Object.defineProperty(this.meta.code, 'node', { + value: meta.code.node, + enumerable: global.env.opts.debug ? true : false + }); } if (meta.code.funcscope) { this.meta.code.funcscope = meta.code.funcscope; @@ -331,7 +410,7 @@ exports.Doclet.prototype.setMeta = function(meta) { this.meta.code.value = meta.code.value; } if (meta.code.paramnames) { - this.meta.code.paramnames = meta.code.paramnames.concat([]); + this.meta.code.paramnames = meta.code.paramnames.slice(0); } } }; diff --git a/node_modules/jsdoc/lib/jsdoc/fs.js b/node_modules/jsdoc/lib/jsdoc/fs.js index ee365a8..4bb8966 100644 --- a/node_modules/jsdoc/lib/jsdoc/fs.js +++ b/node_modules/jsdoc/lib/jsdoc/fs.js @@ -2,13 +2,73 @@ * Extended version of the standard `fs` module. * @module jsdoc/fs */ +'use strict'; -var fs = exports.fs = require('fs'); -var vm = require('jsdoc/util/vm'); +var fs = require('fs'); +var path = require('path'); +var runtime = require('jsdoc/util/runtime'); + +var ls = exports.ls = function(dir, recurse, _allFiles, _path) { + var file; + var files; + var isFile; + + // first pass + if (_path === undefined) { + _allFiles = []; + _path = [dir]; + } + + if (!_path.length) { + return _allFiles; + } + + if (recurse === undefined) { + recurse = 1; + } + + try { + isFile = fs.statSync(dir).isFile(); + } + catch (e) { + isFile = false; + } + if (isFile) { + files = [dir]; + } + else { + files = fs.readdirSync(dir); + } + + for (var i = 0, l = files.length; i < l; i++) { + file = String(files[i]); + + // skip dot files + if (file.match(/^\.[^\.\/\\]/)) { + continue; + } + + if ( fs.statSync(path.join(_path.join('/'), file)).isDirectory() ) { + // it's a directory + _path.push(file); + + if (_path.length - 1 < recurse) { + ls(_path.join('/'), recurse, _allFiles, _path); + } + _path.pop(); + } + else { + // it's a file + _allFiles.push( path.normalize(path.join(_path.join('/'), file)) ); + } + } + + return _allFiles; +}; // export the VM-specific implementations of the extra methods // TODO: document extra methods here -var extras = vm.getModule('fs'); +var extras = require( runtime.getModulePath('fs') ); Object.keys(extras).forEach(function(extra) { exports[extra] = extras[extra]; }); diff --git a/node_modules/jsdoc/lib/jsdoc/name.js b/node_modules/jsdoc/lib/jsdoc/name.js index ccba3dc..aee46a8 100644 --- a/node_modules/jsdoc/lib/jsdoc/name.js +++ b/node_modules/jsdoc/lib/jsdoc/name.js @@ -3,50 +3,83 @@ @module jsdoc/name @requires jsdoc/tag/dictionary @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; -var jsdoc = { - tagDictionary: require('jsdoc/tag/dictionary') +var _ = require('underscore'); + +// 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 STATIC = exports.STATIC = '.'; +var scopeToPunc = exports.scopeToPunc = { + 'inner': INNER, + 'instance': INSTANCE, + 'static': STATIC +}; +var puncToScope = exports.puncToScope = _.invert(scopeToPunc); -var puncToScope = { '.': 'static', '~': 'inner', '#': 'instance' }, - scopeToPunc = { 'static': '.', 'inner': '~', 'instance': '#' }; +var DEFAULT_SCOPE = SCOPE_NAMES.static; +var REGEXP_SCOPE_PUNC = '([' + INNER + INSTANCE + STATIC + '])'; -var DEFAULT_SCOPE = 'static'; +function nameIsLongname(name, memberof) { + var regexp = new RegExp('^' + memberof + REGEXP_SCOPE_PUNC); + + return regexp.test(name); +} + +function prototypeToPunc(name) { + return name.replace(/(?:^|\.)prototype\.?/g, INSTANCE); +} /** Resolves the longname, memberof, variation and name values of the given doclet. @param {module:jsdoc/doclet.Doclet} doclet */ exports.resolve = function(doclet) { - var name = doclet.name ? String(doclet.name) : '', - memberof = doclet.memberof || '', - about = {}, - parentDoc; + 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; // change MyClass.prototype.instanceMethod to MyClass#instanceMethod // (but not in function params, which lack doclet.kind) + // TODO: check for specific doclet.kind values (probably function, class, and module) if (name && doclet.kind) { - name = name.replace(/(?:^|\.)prototype\.?/g, '#'); + name = prototypeToPunc(name); } doclet.name = name; - + // 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 + '~' + name; + name = doclet.longname = doclet.meta.code.funcscope + INNER + name; } if (memberof || doclet.forceMemberof) { // @memberof tag given - memberof = ('' || memberof).replace(/\.prototype\.?/g, '#'); - - // the name is a fullname, like @name foo.bar, @memberof foo - if (name && name.indexOf(memberof) === 0 && name !== memberof) { + memberof = prototypeToPunc(memberof); + + // the name is a complete longname, like @name foo.bar, @memberof foo + if (name && nameIsLongname(name, memberof) && name !== memberof) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // 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:') === 0) { + else if (name && name === memberof && name.indexOf(MODULE_PREFIX) === 0) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // the name and memberof are identical, like @name foo, @memberof foo @@ -56,7 +89,7 @@ exports.resolve = function(doclet) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // like @memberof foo# or @memberof foo~ - else if (name && /([#.~])$/.test(memberof) ) { + else if (name && trailingScope.test(memberof) ) { about = exports.shorten(memberof + name, (doclet.forceMemberof ? memberof : undefined)); } else if (name && doclet.scope) { @@ -65,27 +98,27 @@ exports.resolve = function(doclet) { } } else { // no @memberof - about = exports.shorten(name); + about = exports.shorten(name); } - + if (about.name) { doclet.name = about.name; } - + if (about.memberof) { doclet.setMemberof(about.memberof); } - - if (about.longname && !doclet.longname) { + + if (about.longname && (!doclet.longname || doclet.longname === doclet.name)) { doclet.setLongname(about.longname); } - + if (doclet.scope === 'global') { // via @global tag? doclet.setLongname(doclet.name); delete doclet.memberof; } else if (about.scope) { - if (about.memberof === '') { // via @memberof ? + if (about.memberof === GLOBAL_LONGNAME) { // via @memberof ? doclet.scope = 'global'; } else { @@ -94,7 +127,7 @@ exports.resolve = function(doclet) { } else { if (doclet.name && doclet.memberof && !doclet.longname) { - if ( /^([#.~])/.test(doclet.name) ) { + if ( leadingScope.test(doclet.name) ) { doclet.scope = puncToScope[RegExp.$1]; doclet.name = doclet.name.substr(1); } @@ -109,29 +142,17 @@ exports.resolve = function(doclet) { if (about.variation) { doclet.variation = about.variation; } -}; -/** - @inner - @memberof module:jsdoc/name - @param {string} name - @param {string} kind - @returns {string} The name with unsafe names enclosed in quotes. - */ -function quoteUnsafe(name, kind) { // docspaced names may have unsafe characters which need to be quoted by us - if ( (jsdoc.tagDictionary.lookUp(kind).setsDocletDocspace) && /[^$_a-zA-Z0-9\/]/.test(name) ) { - if (!/^[a-z_$-\/]+:\"/i.test(name)) { - return '"' + name.replace(/\"/g, '"') + '"'; - } + // if we never found a longname, just use an empty string + if (!doclet.longname) { + doclet.longname = ''; } - - return name; -} +}; // 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, "\\$&"); + var specials = new RegExp('[.*+?|()\\[\\]{}\\\\]', 'g'); // .*+?|()[]{}\ + return str.replace(specials, '\\$&'); }; /** @@ -146,9 +167,9 @@ 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(RegExp.escape(name) + '$'), ns + ':' + name ); } - + return longname; }; @@ -162,7 +183,7 @@ exports.applyNamespace = function(longname, ns) { exports.shorten = function(longname, forcedMemberof) { // quoted strings in a longname are atomic, convert to tokens var atoms = [], token; - + // handle quoted names like foo["bar"] or foo['bar'] longname = longname.replace(/(\[?["'].+?["']\]?)/g, function($) { var dot = ''; @@ -170,21 +191,21 @@ exports.shorten = function(longname, forcedMemberof) { dot = '.'; $ = $.replace( /^\[/g, '' ).replace( /\]$/g, '' ); } - + token = '@{' + atoms.length + '}@'; atoms.push($); return dot + token; // foo["bar"] => foo.@{1}@ }); - + var name = '', scope = '', // ., ~, or # memberof = '', parts, variation; - - longname = longname.replace( /\.prototype\.?/g, '#' ); - + + longname = prototypeToPunc(longname); + if (typeof forcedMemberof !== 'undefined') { name = longname.substr(forcedMemberof.length); parts = forcedMemberof.match(/^(.*?)([#.~]?)$/); @@ -193,28 +214,28 @@ exports.shorten = function(longname, forcedMemberof) { if (parts[2]) { scope = parts[2]; } } else { - parts = longname? - (longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse() - : ['']; - + 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 # memberof = parts[2] || ''; } - + // like /** @name foo.bar(2) */ if ( /(.+)\(([^)]+)\)$/.test(name) ) { name = RegExp.$1; variation = RegExp.$2; } - + //// restore quoted strings back again var i = atoms.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 + '}@', atoms[i]); + memberof = memberof.replace('@{' + i + '}@', atoms[i]); + scope = scope.replace('@{' + i + '}@', atoms[i]); + name = name.replace('@{' + i + '}@', atoms[i]); } //// diff --git a/node_modules/jsdoc/lib/jsdoc/opts/argparser.js b/node_modules/jsdoc/lib/jsdoc/opts/argparser.js index 7e68580..c33db9d 100644 --- a/node_modules/jsdoc/lib/jsdoc/opts/argparser.js +++ b/node_modules/jsdoc/lib/jsdoc/opts/argparser.js @@ -1,38 +1,57 @@ /** - Parse the command line arguments. - @module jsdoc/opts/argparser - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + * Parse the command line arguments. + * @module jsdoc/opts/argparser + * @author Michael Mathews + * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var _ = require('underscore'); 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 + * Create an instance of the parser. + * @classdesc A parser to interpret the key-value pairs entered on the command line. + * @constructor */ var ArgParser = function() { - this._options = []; - this._shortNameIndex = {}; - this._longNameIndex = {}; + this._options = []; + this._shortNameIndex = {}; + this._longNameIndex = {}; }; ArgParser.prototype._getOptionByShortName = function(name) { - if (hasOwnProp.call(this._shortNameIndex, name)) { - return this._options[this._shortNameIndex[name]]; - } - return null; + if (hasOwnProp.call(this._shortNameIndex, name)) { + return this._options[this._shortNameIndex[name]]; + } + return null; }; ArgParser.prototype._getOptionByLongName = function(name) { - if (hasOwnProp.call(this._longNameIndex, name)) { - return this._options[this._longNameIndex[name]]; - } - return null; + if (hasOwnProp.call(this._longNameIndex, name)) { + return this._options[this._longNameIndex[name]]; + } + return null; +}; + +ArgParser.prototype._addOption = function(option) { + var currentIndex; + + var longName = option.longName; + var shortName = option.shortName; + + this._options.push(option); + currentIndex = this._options.length - 1; + + if (shortName) { + this._shortNameIndex[shortName] = currentIndex; + } + if (longName) { + this._longNameIndex[longName] = currentIndex; + } + + return this; }; /** @@ -43,137 +62,240 @@ ArgParser.prototype._getOptionByLongName = function(name) { * @param {string} helpText A brief description of the option. * @param {boolean} [canHaveMultiple=false] Set to `true` if the option can be provided more than once. * @param {function} [coercer] A function to coerce the given value to a specific type. + * @return {this} * @example * myParser.addOption('t', 'template', true, 'The path to the template.'); * myParser.addOption('h', 'help', false, 'Show the help message.'); */ ArgParser.prototype.addOption = function(shortName, longName, hasValue, helpText, canHaveMultiple, coercer) { - this._options.push({ - shortName: shortName, - longName: longName, - hasValue: hasValue, - helpText: helpText, - canHaveMultiple: (canHaveMultiple || false), - coercer: coercer - }); - - if (shortName) { - this._shortNameIndex[shortName] = this._options.length - 1; - } - if (longName) { - this._longNameIndex[longName] = this._options.length - 1; - } + var option = { + shortName: shortName, + longName: longName, + hasValue: hasValue, + helpText: helpText, + canHaveMultiple: (canHaveMultiple || false), + coercer: coercer + }; + + return this._addOption(option); }; +// TODO: refactor addOption to accept objects, then get rid of this method /** - Generate a summary of all the options with corresponding help text. - @returns {string} + * Provide information about an option that should not cause an error if present, but that is always + * ignored (for example, an option that was used in previous versions but is no longer supported). + * + * @private + * @param {string} shortName - The short name of the option with a leading hyphen (for example, + * `-v`). + * @param {string} longName - The long name of the option with two leading hyphens (for example, + * `--version`). + */ +ArgParser.prototype.addIgnoredOption = function(shortName, longName) { + var option = { + shortName: shortName, + longName: longName, + ignore: true + }; + + return this._addOption(option); +}; + +function padding(length) { + return new Array(length + 1).join(' '); +} + +function padLeft(str, length) { + return padding(length) + str; +} + +function padRight(str, length) { + return str + padding(length); +} + +function findMaxLength(arr) { + var max = 0; + + arr.forEach(function(item) { + if (item.length > max) { + max = item.length; + } + }); + + return max; +} + +function concatWithMaxLength(items, maxLength) { + var result = ''; + // to prevent endless loops, always use the first item, regardless of length + result += items.shift(); + + while ( items.length && (result.length + items[0].length < maxLength) ) { + result += ' ' + items.shift(); + } + + return result; +} + +// we want to format names and descriptions like this: +// | -f, --foo Very long description very long description very long | +// | description very long description. | +function formatHelpInfo(options) { + var MARGIN_LENGTH = 4; + var results = []; + + var maxLength = process.stdout.columns; + var maxNameLength = findMaxLength(options.names); + var maxDescriptionLength = findMaxLength(options.descriptions); + + var wrapDescriptionAt = maxLength - (MARGIN_LENGTH * 3) - maxNameLength; + // build the string for each option + options.names.forEach(function(name, i) { + var result; + var partialDescription; + var words; + + // add a left margin to the name + result = padLeft(options.names[i], MARGIN_LENGTH); + // and a right margin, with extra padding so the descriptions line up with one another + result = padRight(result, maxNameLength - options.names[i].length + MARGIN_LENGTH); + + // split the description on spaces + words = options.descriptions[i].split(' '); + // add as much of the description as we can fit on the first line + result += concatWithMaxLength(words, wrapDescriptionAt); + // if there's anything left, keep going until we've consumed the description + while (words.length) { + partialDescription = padding( maxNameLength + (MARGIN_LENGTH * 2) ); + partialDescription += concatWithMaxLength(words, wrapDescriptionAt); + result += '\n' + partialDescription; + } + + results.push(result); + }); + + return results; +} + +/** + * Generate a summary of all the options with corresponding help text. + * @returns {string} */ ArgParser.prototype.help = function() { - var helpArr = ['OPTIONS:'], - option, optionHelp; + var options = { + names: [], + descriptions: [] + }; - for (var i = 0, leni = this._options.length; i < leni; i++) { - option = this._options[i]; - optionHelp = '\t'; + this._options.forEach(function(option) { + var name = ''; - if (option.shortName) { - optionHelp += '-' + option.shortName + (option.longName ? ', ' : ''); - } + // don't show ignored options + if (option.ignore) { + return; + } - if (option.longName) { - optionHelp += '--' + option.longName; - } + if (option.shortName) { + name += '-' + option.shortName + (option.longName ? ', ' : ''); + } - if (option.hasValue) { - optionHelp += ' '; - } + if (option.longName) { + name += '--' + option.longName; + } - optionHelp += '\t\t' + option.helpText; - helpArr.push(optionHelp); - } + if (option.hasValue) { + name += ' '; + } - return helpArr.join('\n'); + options.names.push(name); + options.descriptions.push(option.helpText); + }); + + return 'Options:\n' + formatHelpInfo(options).join('\n'); }; /** - Get the options. - @param {Array.} args An array, like ['-x', 'hello'] - @param {Object} [defaults={}] An optional collection of default values. - @returns {Object} The keys will be the longNames, or the shortName if - no longName is defined for that option. The values will be the values - provided, or `true` if the option accepts no value. + * Get the options. + * @param {Array.} args An array, like ['-x', 'hello'] + * @param {Object} [defaults={}] An optional collection of default values. + * @returns {Object} The keys will be the longNames, or the shortName if no longName is defined for + * that option. The values will be the values provided, or `true` if the option accepts no value. */ ArgParser.prototype.parse = function(args, defaults) { - var result = defaults && _.defaults({}, defaults) || {}; + var result = defaults && _.defaults({}, defaults) || {}; - result._ = []; - for (var i = 0, leni = args.length; i < leni; i++) { - var arg = '' + args[i], - next = (i < leni-1)? '' + args[i+1] : null, - option, - shortName = null, - longName, - name, - value = null; + result._ = []; + for (var i = 0, leni = args.length; i < leni; i++) { + var arg = '' + args[i], + next = (i < leni - 1) ? '' + args[i + 1] : null, + option, + shortName = null, + longName, + name, + value = null; - // like -t - if (arg.charAt(0) === '-') { + // like -t + if (arg.charAt(0) === '-') { - // like --template - if (arg.charAt(1) === '-') { - name = longName = arg.slice(2); - option = this._getOptionByLongName(longName); - } - else { - name = shortName = arg.slice(1); - option = this._getOptionByShortName(shortName); - } + // like --template + if (arg.charAt(1) === '-') { + name = longName = arg.slice(2); + option = this._getOptionByLongName(longName); + } + else { + name = shortName = arg.slice(1); + option = this._getOptionByShortName(shortName); + } - if (option === null) { - throw new Error( 'Unknown command line option found: ' + name ); - } + if (option === null) { + throw new Error( 'Unknown command line option found: ' + name ); + } - if (option.hasValue) { - value = next; - i++; + if (option.hasValue) { + value = next; + i++; - if (value === null || value.charAt(0) === '-') { - throw new Error( 'Command line option requires a value: ' + name ); - } - } - else { - value = true; - } + if (value === null || value.charAt(0) === '-') { + throw new Error( 'Command line option requires a value: ' + name ); + } + } + else { + value = true; + } - if (option.longName && shortName) { - name = option.longName; - } + // skip ignored options now that we've consumed the option text + if (option.ignore) { + continue; + } - if (typeof option.coercer === 'function') { - value = option.coercer(value); - } - - // Allow for multiple options of the same type to be present - if (option.canHaveMultiple && hasOwnProp.call(result, name)) { - var val = result[name]; - - if (val instanceof Array) { - val.push(value); - } else { - result[name] = [val, value]; - } - } - else { - result[name] = value; - } - } - else { - result._.push(arg); - } - } + if (option.longName && shortName) { + name = option.longName; + } - return result; + if (typeof option.coercer === 'function') { + value = option.coercer(value); + } + + // Allow for multiple options of the same type to be present + if (option.canHaveMultiple && hasOwnProp.call(result, name)) { + var val = result[name]; + + if (val instanceof Array) { + val.push(value); + } else { + result[name] = [val, value]; + } + } + else { + result[name] = value; + } + } + else { + result._.push(arg); + } + } + + return result; }; module.exports = ArgParser; diff --git a/node_modules/jsdoc/lib/jsdoc/opts/args.js b/node_modules/jsdoc/lib/jsdoc/opts/args.js index 994502f..bddd565 100644 --- a/node_modules/jsdoc/lib/jsdoc/opts/args.js +++ b/node_modules/jsdoc/lib/jsdoc/opts/args.js @@ -1,66 +1,76 @@ /** - @module jsdoc/opts/args - @requires jsdoc/opts/argparser - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + * @module jsdoc/opts/args + * @requires jsdoc/opts/argparser + * @author Michael Mathews + * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; -var ArgParser = require('jsdoc/opts/argparser'), - argParser = new ArgParser(), - hasOwnProp = Object.prototype.hasOwnProperty, - ourOptions, - querystring = require('querystring'), - util = require('util'); +var ArgParser = require('jsdoc/opts/argparser'); +var querystring = require('querystring'); +var util = require('util'); +var ourOptions; + +var argParser = new ArgParser(); +var hasOwnProp = Object.prototype.hasOwnProperty; // cast strings to booleans or integers where appropriate function castTypes(item) { - var result = item; + var integer; - switch (result) { - case 'true': - return true; - case 'false': - return false; - default: - // might be an integer - var integer = parseInt(result, 10); - if (String(integer) === result && integer !== 'NaN') { - return integer; - } else { - return result; - } - } + var result = item; + + switch (result) { + case 'true': + result = true; + break; + + case 'false': + result = false; + break; + + default: + // might be an integer + integer = parseInt(result, 10); + if (String(integer) === result && integer !== 'NaN') { + result = integer; + } + } + + return result; } // check for strings that we need to cast to other types function fixTypes(item) { - var result = item; + var result = item; - // recursively process arrays and objects - if ( util.isArray(result) ) { - for (var i = 0, l = result.length; i < l; i++) { - result[i] = fixTypes(result[i]); - } - } else if (typeof result === 'object') { - Object.keys(result).forEach(function(prop) { - result[prop] = fixTypes(result[prop]); - }); - } else { - result = castTypes(result); - } + // recursively process arrays and objects + if ( util.isArray(result) ) { + for (var i = 0, l = result.length; i < l; i++) { + result[i] = fixTypes(result[i]); + } + } + else if (typeof result === 'object') { + Object.keys(result).forEach(function(prop) { + result[prop] = fixTypes(result[prop]); + }); + } + else { + result = castTypes(result); + } - return result; + return result; } function parseQuery(str) { - var result = querystring.parse(str); + var result = querystring.parse(str); - Object.keys(result).forEach(function(prop) { - result[prop] = fixTypes(result[prop]); - }); + Object.keys(result).forEach(function(prop) { + result[prop] = fixTypes(result[prop]); + }); - return result; + return result; } argParser.addOption('t', 'template', true, 'The path to the template to use. Default: path/to/jsdoc/templates/default'); @@ -70,58 +80,59 @@ 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('l', 'lenient', false, 'Continue to generate output if a doclet is incomplete or contains errors. Default: false'); 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('q', 'query', true, 'A query string to parse and store in env.opts.query. Example: foo=bar&baz=true', false, parseQuery); 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'); -//TODO [-R, recurseonly] = a number representing the depth to recurse -//TODO [-f, filter] = a regex to filter on <-- this can be better defined in the configs? +// 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.'); -//Here are options specific to tests -argParser.addOption(null, 'verbose', false, 'Display verbose output for 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'); +// Options that are no longer supported and should be ignored +argParser.addIgnoredOption('l', 'lenient'); // removed in JSDoc 3.3.0 /** - Set the options for this app. - @throws {Error} Illegal arguments will throw errors. - @param {string|String[]} args The command line arguments for this app. + * Set the options for this app. + * @throws {Error} Illegal arguments will throw errors. + * @param {string|String[]} args The command line arguments for this app. */ exports.parse = function(args) { - args = args || []; + args = args || []; - if (typeof args === 'string' || args.constructor === String) { - args = (''+args).split(/\s+/g); - } + if (typeof args === 'string' || args.constructor === String) { + args = String(args).split(/\s+/g); + } - ourOptions = argParser.parse(args); + ourOptions = argParser.parse(args); - return ourOptions; + return ourOptions; }; /** - Display help message for options. + * Retrieve help message for options. */ exports.help = function() { return argParser.help(); }; /** - Get a named option. - @param {string} name The name of the option. - @return {string} The value associated with the given name. + * Get a named option. + * @param {string} name The name of the option. + * @return {string} The value associated with the given name. *//** - Get all the options for this app. - @return {Object} A collection of key/values representing all the options. + * Get all the options for this app. + * @return {Object} A collection of key/values representing all the options. */ exports.get = function(name) { - if (typeof name === 'undefined') { - return ourOptions; - } - else { - return ourOptions[name]; - } + if (typeof name === 'undefined') { + return ourOptions; + } + else if ( hasOwnProp.call(ourOptions, name) ) { + return ourOptions[name]; + } }; diff --git a/node_modules/jsdoc/lib/jsdoc/package.js b/node_modules/jsdoc/lib/jsdoc/package.js index 9b9cf99..135c9ab 100644 --- a/node_modules/jsdoc/lib/jsdoc/package.js +++ b/node_modules/jsdoc/lib/jsdoc/package.js @@ -1,12 +1,13 @@ /** @overview @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; /** - @module jsdoc/package - @see http://wiki.commonjs.org/wiki/Packages/1.0 + @module jsdoc/package + @see http://wiki.commonjs.org/wiki/Packages/1.0 */ /** @@ -15,45 +16,45 @@ @param {string} json - The contents of package.json. */ exports.Package = function(json) { - json = json || "{}"; + json = json || '{}'; /** The source files associated with this package. @type {Array} */ this.files = []; - + /** The kind of this package. @readonly @default @type {string} */ this.kind = 'package'; - + json = JSON.parse(json); - + /** 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; - + /** The longname of this package. @type {string} */ this.longname = this.kind + ':' + this.name; - + /** The description of this package. @type {string} */ this.description = json.description; - + /** The hash summary of the source file. @type {string} @since 3.2.0 */ this.version = json.version; - + /** * The licenses of this package. * @type {Array} diff --git a/node_modules/jsdoc/lib/jsdoc/path.js b/node_modules/jsdoc/lib/jsdoc/path.js index ea405e8..3b8b660 100644 --- a/node_modules/jsdoc/lib/jsdoc/path.js +++ b/node_modules/jsdoc/lib/jsdoc/path.js @@ -1,12 +1,13 @@ +/*global env: true */ /** * Extended version of the standard `path` module. * @module jsdoc/path */ +'use strict'; var fs = require('fs'); var path = require('path'); -var vm = require('jsdoc/util/vm'); - +var runtime = require('jsdoc/util/runtime'); function prefixReducer(previousPath, current) { var currentPath = []; @@ -16,7 +17,7 @@ function prefixReducer(previousPath, current) { return currentPath; } - currentPath = path.resolve( process.cwd(), path.dirname(current) ).split(path.sep) || []; + currentPath = path.resolve(global.env.pwd, current).split(path.sep) || []; if (previousPath && currentPath.length) { // remove chunks that exceed the previous path's length @@ -40,6 +41,7 @@ function prefixReducer(previousPath, current) { * * For example, assuming that the current working directory is `/Users/jsdoc`: * + * + For the single path `foo/bar/baz/qux.js`, the common prefix is `foo/bar/baz/`. * + For paths `foo/bar/baz/qux.js`, `foo/bar/baz/quux.js`, and `foo/bar/baz.js`, the common prefix * is `/Users/jsdoc/foo/bar/`. * + For paths `../jsdoc/foo/bar/baz/qux/quux/test.js`, `/Users/jsdoc/foo/bar/bazzy.js`, and @@ -51,47 +53,42 @@ function prefixReducer(previousPath, current) { * @return {string} The common prefix, or an empty string if there is no common prefix. */ exports.commonPrefix = function(paths) { - var common; + var segments; + + var prefix = ''; paths = paths || []; - common = paths.reduce(prefixReducer, undefined) || []; - // if there's anything left (other than a placeholder for a leading slash), add a placeholder - // for a trailing slash - if ( common.length && (common.length > 1 || common[0] !== '') ) { - common.push(''); + // if there's only one path, its resolved dirname (plus a trailing slash) is the common prefix + if (paths.length === 1) { + prefix = path.resolve(global.env.pwd, paths[0]); + if ( path.extname(prefix) ) { + prefix = path.dirname(prefix); + } + + prefix += path.sep; + } + else { + segments = paths.reduce(prefixReducer, undefined) || []; + + // if there's anything left (other than a placeholder for a leading slash), add a + // placeholder for a trailing slash + if ( segments.length && (segments.length > 1 || segments[0] !== '') ) { + segments.push(''); + } + + prefix = segments.join(path.sep); } - return common.join(path.sep); + return prefix; }; -// TODO: do we need this? -/** - * If required by the current VM, convert a path to a URI that meets the operating system's - * requirements. Otherwise, return the original path. - * @function - * @private - * @param {string} path The path to convert. - * @return {string} A URI that meets the operating system's requirements, or the original path. - */ -var pathToUri = vm.getModule('jsdoc').pathToUri; - -// TODO: do we need this? if so, any way to stop exporting it? -/** - * If required by the current VM, convert a URI to a path that meets the operating system's - * requirements. Otherwise, assume the "URI" is really a path, and return the original path. - * @function - * @private - * @param {string} uri The URI to convert. - * @return {string} A path that meets the operating system's requirements. - */ -exports._uriToPath = vm.getModule('jsdoc').uriToPath; - /** * Retrieve the fully qualified path to the requested resource. * - * If the resource path is specified as a relative path, JSDoc searches for the path in the current - * working directory, then in the JSDoc directory. + * If the resource path is specified as a relative path, JSDoc searches for the path in the + * directory where the JSDoc configuration file is located, then in the current working directory, + * and finally in the JSDoc directory. * * If the resource path is specified as a fully qualified path, JSDoc uses the path as-is. * @@ -102,7 +99,7 @@ exports._uriToPath = vm.getModule('jsdoc').uriToPath; * Includes the filename if one was provided. */ exports.getResourcePath = function(filepath, filename) { - var result; + var result = null; function pathExists(_path) { try { @@ -115,20 +112,18 @@ exports.getResourcePath = function(filepath, filename) { return true; } - // first, try resolving it relative to the current working directory (or just normalize it - // if it's an absolute path) - result = path.resolve(filepath); - if ( !pathExists(result) ) { - // next, try resolving it relative to the JSDoc directory - result = path.resolve(__dirname, filepath); - if ( !pathExists(result) ) { - result = null; + // absolute paths are normalized by path.resolve on the first pass + [path.dirname(global.env.opts.configure || ''), env.pwd, env.dirname].forEach(function(_path) { + if (!result && _path) { + _path = path.resolve(_path, filepath); + if ( pathExists(_path) ) { + result = _path; + } } - } + }); if (result) { result = filename ? path.join(result, filename) : result; - result = pathToUri(result); } return result; diff --git a/node_modules/jsdoc/lib/jsdoc/plugins.js b/node_modules/jsdoc/lib/jsdoc/plugins.js index 5e2637b..a34fccc 100644 --- a/node_modules/jsdoc/lib/jsdoc/plugins.js +++ b/node_modules/jsdoc/lib/jsdoc/plugins.js @@ -3,43 +3,51 @@ * Utility functions to support the JSDoc plugin framework. * @module jsdoc/plugins */ +'use strict'; -var error = require('jsdoc/util/error'); +var logger = require('jsdoc/util/logger'); var path = require('jsdoc/path'); -exports.installPlugins = function(plugins, p) { +function addHandlers(handlers, parser) { + Object.keys(handlers).forEach(function(eventName) { + parser.on(eventName, handlers[eventName]); + }); +} + +exports.installPlugins = function(plugins, parser) { var dictionary = require('jsdoc/tag/dictionary'); - var parser = p; var eventName; var plugin; - var pluginPath; for (var i = 0, l = plugins.length; i < l; i++) { - pluginPath = path.getResourcePath(path.dirname(plugins[i]), path.basename(plugins[i])); - if (!pluginPath) { - error.handle(new Error('Unable to find the plugin "' + plugins[i] + '"')); + plugin = require(plugins[i]); + + // allow user-defined plugins to... + //...register event handlers + if (plugin.handlers) { + addHandlers(plugin.handlers, parser); } - else { - plugin = require(pluginPath); - // allow user-defined plugins to... - //...register event handlers - if (plugin.handlers) { - Object.keys(plugin.handlers).forEach(function(eventName) { - parser.on(eventName, plugin.handlers[eventName]); - }); + //...define tags + if (plugin.defineTags) { + plugin.defineTags(dictionary); + } + + //...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 ' + + 'is not using the Rhino JavaScript parser.', plugins[i]); } - - //...define tags - if (plugin.defineTags) { - plugin.defineTags(dictionary); - } - - //...add a node visitor - if (plugin.nodeVisitor) { + else { parser.addNodeVisitor(plugin.nodeVisitor); } } + + //...add a Mozilla Parser API node visitor + if (plugin.astNodeVisitor) { + parser.addAstNodeVisitor(plugin.astNodeVisitor); + } } }; diff --git a/node_modules/jsdoc/lib/jsdoc/readme.js b/node_modules/jsdoc/lib/jsdoc/readme.js index 0e3ca21..f24317a 100644 --- a/node_modules/jsdoc/lib/jsdoc/readme.js +++ b/node_modules/jsdoc/lib/jsdoc/readme.js @@ -6,9 +6,10 @@ * @author Michael Mathews * @author Ben Blank */ +'use strict'; var fs = require('jsdoc/fs'), - markdown = require('jsdoc/util/markdown'); + markdown = require('jsdoc/util/markdown'); /** * @class @@ -18,7 +19,7 @@ var fs = require('jsdoc/fs'), function ReadMe(path) { var content = fs.readFileSync(path, env.opts.encoding), parse = markdown.getParser(); - + this.html = parse(content); } diff --git a/node_modules/jsdoc/lib/jsdoc/schema.js b/node_modules/jsdoc/lib/jsdoc/schema.js index 2fa32dd..0444c6f 100644 --- a/node_modules/jsdoc/lib/jsdoc/schema.js +++ b/node_modules/jsdoc/lib/jsdoc/schema.js @@ -1,308 +1,624 @@ /** - @overview Schema for validating JSON produced by JSDoc Toolkit. - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - @see + * @overview Schema for validating JSDoc doclets. + * + * @author Michael Mathews + * @author Jeff Williams + * @license Apache License 2.0 - See file 'LICENSE.md' in this project. + * @see */ +'use strict'; -exports.jsdocSchema = { - "properties": { - "doc": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "author": { - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } +// JSON schema types +var ARRAY = 'array'; +var BOOLEAN = 'boolean'; +var INTEGER = 'integer'; +var NULL = 'null'; +var NUMBER = 'number'; +var OBJECT = 'object'; +var STRING = 'string'; +var UNDEFINED = 'undefined'; + +var BOOLEAN_OPTIONAL = [BOOLEAN, NULL, UNDEFINED]; +var STRING_OPTIONAL = [STRING, NULL, UNDEFINED]; + +var EVENT_REGEXP = /event\:[\S]+/; +var PACKAGE_REGEXP = /package\:[\S]+/; + +// information about the code associated with a doclet +var META_SCHEMA = exports.META_SCHEMA = { + type: OBJECT, + optional: true, + additionalProperties: false, + properties: { + code: { + type: OBJECT, + additionalProperties: false, + properties: { + funcscope: { + type: STRING, + optional: true + }, + id: { + type: STRING, + optional: true + }, + name: { + type: STRING, + optional: true + }, + node: { + type: OBJECT, + optional: true + }, + paramnames: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING + } + }, + type: { + type: STRING, + optional: true + }, + value: { + optional: true + } + } + }, + filename: { + title: 'The name of the file that contains the code associated with this doclet.', + type: STRING, + optional: true + }, + lineno: { + title: 'The line number of the code associated with this doclet.', + type: NUMBER, + optional: true + }, + path: { + title: 'The path in which the code associated with this doclet is located.', + type: STRING, + optional: true + }, + range: { + title: 'The positions of the first and last characters of the code associated with ' + + 'this doclet.', + type: ARRAY, + optional: true, + minItems: 2, + maxItems: 2, + items: { + type: NUMBER + } + }, + vars: { + type: OBJECT + } + } +}; + +// type property containing type names +var TYPE_PROPERTY_SCHEMA = exports.TYPE_PROPERTY_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + names: { + type: ARRAY, + minItems: 1, + items: { + type: STRING + } + } + } +}; + +// enumeration properties +var ENUM_PROPERTY_SCHEMA = exports.ENUM_PROPERTY_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + comment: { + type: STRING + }, + defaultvalue: { + type: STRING_OPTIONAL, + optional: true + }, + description: { + type: STRING_OPTIONAL, + optional: true + }, + kind: { + type: STRING, + // TODO: get this from a real enum somewhere + enum: ['member'] + }, + longname: { + type: STRING + }, + memberof: { + type: STRING, + optional: true + }, + meta: META_SCHEMA, + name: { + type: STRING + }, + // is this member nullable? (derived from the type expression) + nullable: { + type: BOOLEAN_OPTIONAL + }, + // is this member optional? (derived from the type expression) + optional: { + type: BOOLEAN_OPTIONAL + }, + scope: { + type: STRING, + // TODO: get this from a real enum somewhere + enum: ['static'] + }, + type: TYPE_PROPERTY_SCHEMA, + // can this member be provided more than once? (derived from the type expression) + variable: { + type: BOOLEAN_OPTIONAL + } + } +}; + +// function parameter, or object property defined with @property tag +var PARAM_SCHEMA = exports.PARAM_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + // what is the default value for this parameter? + defaultvalue: { + type: STRING_OPTIONAL, + optional: true + }, + // a description of the parameter + description: { + type: STRING_OPTIONAL, + optional: true + }, + // what name does this parameter have within the function? + name: { + type: STRING + }, + // can the value for this parameter be null? + nullable: { + type: BOOLEAN_OPTIONAL, + optional: true + }, + // is a value for this parameter optional? + optional: { + type: BOOLEAN_OPTIONAL, + optional: true + }, + // what are the types of value expected for this parameter? + type: TYPE_PROPERTY_SCHEMA, + // can this parameter be repeated? + variable: { + type: BOOLEAN_OPTIONAL, + optional: true + } + } +}; + +var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + // what access privileges are allowed + access: { + type: STRING, + optional: true, + // TODO: define this as an enumeration elsewhere + enum: [ + 'private', + 'protected' + ] + }, + alias: { + type: STRING, + optional: true + }, + augments: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING + } + }, + author: { + type: ARRAY, + optional: true, + items: { + type: STRING + } + }, + borrowed: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: OBJECT, + additionalProperties: false, + properties: { + // name of the target + as: { + type: STRING, + optional: true }, - "path": { // unique identifier for each doc - "type": "string", - "maxItems": 1 - }, - "description": { // a description - "type": "string", - "optional": true, - "maxItems": 1 - }, - "classdesc": { // a description of the class that this constructor belongs to - "type": "string", - "optional": true, - "maxItems": 1 - }, - "name": { // probably a trailing substring of the path - "type": "string", - "maxItems": 1 - }, - "version": { // what is the version of this doc - "type": "string", - "optional": true, - "maxItems": 1 - }, - "since": { // at what previous version was this doc added? - "type": "string", - "optional": true, - "maxItems": 1 - }, - "see": { // some thing else to consider - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "tutorials": { // extended tutorials - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "deprecated": { // is usage of this symbol deprecated? - "type": ["string", "boolean"], - "optional": true - }, - "scope": { // how is this symbol attached to it's enclosing scope? - "type": "string", - "maxItems": 1, - "enum": ["global", "static", "instance", "inner"] - }, - "memberof": { // probably a leading substring of the path - "type": "string", - "optional": true, - "maxItems": 1 - }, - "extends": { // the path to another constructor - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "fires": { // the path to another doc object - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "requires": { // the symbol being documented requires another symbol - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "implements": { - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "kind": { // what kind of symbol is this? - "type": "string", - "maxItems": 1, - "enum": ["constructor", "module", "event", "namespace", "method", "member", "enum", "class", "interface", "constant", "mixin", "file", "version"] - }, - "refersto": { // the path to another doc: this doc is simply a renamed alias to that - "type": "string", - "optional": true, - "maxItems": 1 - }, - "access": { // what access priviledges are allowed - "type": "string", - "optional": true, - "maxItems": 1, - "enum": ["private", "protected", "public"] - }, - "virtual": { // is a member left to be implemented during inheritance? - "type": "boolean", - "optional": true, - "default": false - }, - "attrib": { // other attributes, like "readonly" - "type": "string", - "optional": true - }, - "type": { // what type is the value that this doc is associated with, like "number" - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "exception" : { - "optional": true, - "type": "object", - "properties": { - "type": { // what is the type of the value thrown? - "type": "array", - "optional": true, - "items": { - "type": "string" - } - }, - "description": { // a description of the thrown value - "type": "string", - "optional": true - } - }, - "additionalProperties": false - }, - "returns" : { - "optional": true, - "type": "object", - "properties": { - "type": { // what is the type of the value returned? - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "description": { // a description of the returned value - "type": "string", - "optional": true - } - }, - "additionalProperties": false - }, - "param" : { // are there function parameters associated with this doc? - "type": "array", - "optional": true, - "items": { - "type": "object", - "properties": { - "type": { // what are the types of value expected for this parameter? - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "optional": { // is a value for this parameter optional? - "type": "boolean", - "optional": true, - "default": true - }, - "nullable": { // can the value for this parameter be null? - "type": "boolean", - "optional": true, - "default": true - }, - "defaultvalue": { // what is the default value for this parameter? - "type": "string", - "optional": true - }, - "name": { // what name does this parameter have within the function? - "type": "string" - }, - "description": { // a description of the parameter - "type": "string", - "optional": true - } - }, - "additionalProperties": false - } - }, - "thisobj": { - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "example": { // some thing else to consider - "type": ["string", "array"], - "optional": true, - "items": { - "type": "string" - } - }, - "tags": { // arbitrary tags associated with this doc - "type": "array", - "optional": true, - "additionalProperties": false, - "items": { - "type": "string" - } - }, - "meta": { // information about this doc - "type": "object", - "optional": true, - "maxItems": 1, - "properties": { - "file": { // what is the name of the file this doc appears in? - "type": "string", - "optional": true, - "maxItems": 1 - }, - "line": { // on what line of the file does this doc appear? - "type": "number", - "optional": true, - "maxItems": 1 - } - }, - "additionalProperties": false + // name of the source + from: { + type: STRING } } } }, - "meta": { // information about the generation for all the docs - "type": "object", - "optional": true, - "maxItems": 1, - "properties": { - "project": { // to what project does this doc belong? - "type": "object", - "optional": true, - "maxItems": 1, - "properties": { - "name": { // the name of the project - "type": "string", - "maxItems": 1 - }, - "uri": { // the URI of the project - "type": "string", - "maxItems": 1, - "format": "uri" - }, - "version": { // the version of the project - "type": "string", - "maxItems": 1 - }, - "lang": { // the programming language used in the project - "type": "string", - "maxItems": 1 - } + // a description of the class that this constructor belongs to + classdesc: { + type: STRING, + optional: true + }, + comment: { + type: STRING + }, + copyright: { + type: STRING, + optional: true + }, + defaultvalue: { + optional: true + }, + defaultvaluetype: { + type: STRING, + optional: true, + enum: [OBJECT, ARRAY] + }, + // is usage of this symbol deprecated? + deprecated: { + type: [STRING, BOOLEAN], + optional: true + }, + // a description + description: { + type: STRING_OPTIONAL, + optional: true + }, + // something else to consider + examples: { + type: ARRAY, + optional: true, + items: { + type: STRING + } + }, + exceptions: { + type: ARRAY, + optional: true, + items: PARAM_SCHEMA + }, + // the path to another constructor + extends: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING + } + }, + // the path to another doc object + fires: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING, + pattern: EVENT_REGEXP + } + }, + forceMemberof: { + type: BOOLEAN_OPTIONAL, + optional: true + }, + ignore: { + type: BOOLEAN, + optional: true + }, + implements: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING + } + }, + inherited: { + type: BOOLEAN, + optional: true + }, + inherits: { + type: STRING, + optional: true, + dependency: { + inherited: true + } + }, + isEnum: { + type: BOOLEAN, + optional: true + }, + // what kind of symbol is this? + kind: { + type: STRING, + // TODO: define this as an enumeration elsewhere + enum: [ + 'class', + 'constant', + 'event', + 'external', + 'file', + 'function', + 'member', + 'mixin', + 'module', + 'namespace', + 'package', + 'param', + 'typedef' + ] + }, + license: { + type: STRING, + optional: true + }, + listens: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING, + pattern: EVENT_REGEXP + } + }, + longname: { + type: STRING + }, + // probably a leading substring of the path + memberof: { + type: STRING, + optional: true + }, + // information about this doc + meta: META_SCHEMA, + mixes: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: { + type: STRING + } + }, + // probably a trailing substring of the path + name: { + type: STRING + }, + // is this member nullable? (derived from the type expression) + nullable: { + type: BOOLEAN_OPTIONAL + }, + // is this member optional? (derived from the type expression) + optional: { + type: BOOLEAN_OPTIONAL + }, + // are there function parameters associated with this doc? + params: { + type: ARRAY, + optional: true, + uniqueItems: true, + items: PARAM_SCHEMA + }, + preserveName: { + type: BOOLEAN, + optional: true + }, + properties: { + type: ARRAY, + optional: true, + uniqueItems: true, + minItems: 1, + items: { + anyOf: [ENUM_PROPERTY_SCHEMA, PARAM_SCHEMA] + } + }, + readonly: { + type: BOOLEAN, + optional: true + }, + // the symbol being documented requires another symbol + requires: { + type: ARRAY, + optional: true, + uniqueItems: true, + minItems: 1, + items: { + type: STRING + } + }, + returns: { + type: ARRAY, + optional: true, + minItems: 1, + items: PARAM_SCHEMA + }, + // what sort of parent scope does this symbol have? + scope: { + type: STRING, + enum: [ + // TODO: make these an enumeration + 'global', + 'inner', + 'instance', + 'static' + ] + }, + // something else to consider + see: { + type: ARRAY, + optional: true, + minItems: 1, + items: { + type: STRING + } + }, + // at what previous version was this doc added? + since: { + type: STRING, + optional: true + }, + summary: { + type: STRING, + optional: true + }, + // arbitrary tags associated with this doc + tags: { + type: ARRAY, + optional: true, + minItems: 1, + items: { + type: OBJECT, + additionalProperties: false, + properties: { + originalTitle: { + type: STRING }, - "additionalProperties": false - }, - "generated": { // some information about the running of the doc generator - "type": "object", - "optional": true, - "maxItems": 1, - "properties": { - "date": { // on what date and time was the doc generated? - "type": "string", - "maxItems": 1, - "optional": true, - "format": "date-time" - }, - "parser": { // what tool was used to generate the doc? - "type": "string", - "maxItems": 1, - "optional": true - } + text: { + type: STRING, + optional: true }, - "additionalProperties": false + title: { + type: STRING + }, + value: { + type: [STRING, OBJECT], + optional: true, + properties: PARAM_SCHEMA + } } } + }, + 'this': { + type: STRING, + optional: true + }, + todo: { + type: ARRAY, + optional: true, + minItems: 1, + items: { + type: STRING + } + }, + // extended tutorials + tutorials: { + type: ARRAY, + optional: true, + minItems: 1, + items: { + type: STRING + } + }, + // what type is the value that this doc is associated with, like `number` + type: TYPE_PROPERTY_SCHEMA, + undocumented: { + type: BOOLEAN, + optional: true + }, + // can this member be provided more than once? (derived from the type expression) + variable: { + type: BOOLEAN_OPTIONAL + }, + variation: { + type: STRING, + optional: true + }, + // what is the version of this doc + version: { + type: STRING, + optional: true + }, + // is a member left to be implemented during inheritance? + virtual: { + type: BOOLEAN, + optional: true } } -}; \ No newline at end of file +}; + +var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + description: { + type: STRING, + optional: true + }, + files: { + type: ARRAY, + uniqueItems: true, + minItems: 1, + items: { + type: STRING + } + }, + kind: { + type: STRING, + enum: ['package'] + }, + licenses: { + type: ARRAY, + optional: true, + minItems: 1, + items: { + type: OBJECT, + additionalProperties: false, + properties: { + type: { + type: STRING, + optional: true + }, + url: { + type: STRING, + optional: true, + format: 'uri' + } + } + } + }, + longname: { + type: STRING, + optional: true, + pattern: PACKAGE_REGEXP + }, + name: { + type: STRING, + optional: true + }, + version: { + type: STRING, + optional: true + } + } +}; + +var DOCLETS_SCHEMA = exports.DOCLETS_SCHEMA = { + type: ARRAY, + uniqueItems: true, + items: { + anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA] + } +}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js b/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js rename to node_modules/jsdoc/lib/jsdoc/src/astbuilder.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/astnode.js b/node_modules/jsdoc/lib/jsdoc/src/astnode.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/astnode.js rename to node_modules/jsdoc/lib/jsdoc/src/astnode.js diff --git a/node_modules/jsdoc/lib/jsdoc/src/filter.js b/node_modules/jsdoc/lib/jsdoc/src/filter.js index c9e1846..135c4c4 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/filter.js +++ b/node_modules/jsdoc/lib/jsdoc/src/filter.js @@ -1,13 +1,25 @@ +/*global env: true */ /** - @module jsdoc/src/filter - - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @module jsdoc/src/filter + + @author Michael Mathews + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var path = require('jsdoc/path'); -var pwd = process.env.PWD; +var pwd = env.pwd; + +function makeRegExp(config) { + var regExp = null; + + if (config) { + regExp = (typeof config === 'string') ? new RegExp(config) : config; + } + + return regExp; +} /** @constructor @@ -22,12 +34,8 @@ exports.Filter = function(opts) { return path.resolve(pwd, $); }) : null; - this.includePattern = opts.includePattern? - typeof opts.includePattern === 'string'? new RegExp(opts.includePattern) : opts.includePattern - : null; - this.excludePattern = opts.excludePattern? - typeof opts.excludePattern === 'string'? new RegExp(opts.excludePattern) : opts.excludePattern - : null; + this.includePattern = makeRegExp(opts.includePattern); + this.excludePattern = makeRegExp(opts.excludePattern); }; /** @@ -35,19 +43,25 @@ exports.Filter = function(opts) { @returns {boolean} Should the given file be included? */ exports.Filter.prototype.isIncluded = function(filepath) { + var included = true; + filepath = path.resolve(pwd, filepath); if ( this.includePattern && !this.includePattern.test(filepath) ) { - return false; + included = false; } - + if ( this.excludePattern && this.excludePattern.test(filepath) ) { - return false; + included = false; } - - if ( this.exclude && this.exclude.indexOf(filepath) > -1 ) { - return false; + + if (this.exclude) { + this.exclude.forEach(function(exclude) { + if ( filepath.indexOf(exclude) === 0 ) { + included = false; + } + }); } - - return true; + + return included; }; diff --git a/node_modules/jsdoc/lib/jsdoc/src/handlers.js b/node_modules/jsdoc/lib/jsdoc/src/handlers.js index 83d784c..f25368e 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/handlers.js +++ b/node_modules/jsdoc/lib/jsdoc/src/handlers.js @@ -1,23 +1,56 @@ /** * @module jsdoc/src/handlers */ +'use strict'; +var jsdoc = { + doclet: require('jsdoc/doclet'), + name: require('jsdoc/name'), + util: { + logger: require('jsdoc/util/logger') + } +}; +var util = require('util'); var currentModule = null; +var moduleRegExp = /^((?:module.)?exports|this)(\.|$)/; + function getNewDoclet(comment, e) { - var jsdoc = {doclet: require('jsdoc/doclet')}; - var util = require('util'); + var Doclet = jsdoc.doclet.Doclet; + var doclet; var err; try { - return new jsdoc.doclet.Doclet(comment, e); + doclet = new 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) ); - require('jsdoc/util/error').handle(err); - return new jsdoc.doclet.Doclet('', e); + jsdoc.util.logger.error(err); + doclet = new Doclet('', e); + } + + return doclet; +} + +function setCurrentModule(doclet) { + if (doclet.kind === 'module') { + currentModule = doclet.longname; + } +} + +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 + if (!doclet.scope) { + doclet.addTag('inner'); + } + + if (!doclet.memberof && doclet.scope !== 'global') { + doclet.addTag('memberof', currentModule); + } } } @@ -26,41 +59,47 @@ function getNewDoclet(comment, e) { * @param parser */ exports.attachTo = function(parser) { - var jsdoc = {doclet: require('jsdoc/doclet'), name: require('jsdoc/name')}; - - // handles JSDoc comments that include a @name tag -- the code is ignored in such a case - parser.on('jsdocCommentFound', function(e) { - var newDoclet = getNewDoclet(e.comment, e); - - if (!newDoclet.name) { - return false; // only interested in virtual comments (with a @name) here + function filter(doclet) { + // you can't document prototypes + if ( /#$/.test(doclet.longname) ) { + return true; } - addDoclet.call(this, newDoclet); - if (newDoclet.kind === 'module') { - currentModule = newDoclet.longname; + 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); + } } - e.doclet = newDoclet; - - //resolveProperties(newDoclet); - }); - - // handles 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); - - for (var i = 0, l = subDoclets.length; i < l; i++) { - newSymbolDoclet.call(this, subDoclets[i], e); - } - }); + } // TODO: for clarity, decompose into smaller functions function newSymbolDoclet(docletSrc, e) { var memberofName = null, newDoclet = getNewDoclet(docletSrc, e); - // an undocumented symbol right after a virtual comment? rhino mistakenly connected the two - if (newDoclet.name) { // there was a @name in comment + // 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); @@ -68,7 +107,7 @@ exports.attachTo = function(parser) { if (newDoclet.alias) { if (newDoclet.alias === '{@thisClass}') { - memberofName = this.resolveThis(e.astnode); + memberofName = parser.resolveThis(e.astnode); // "class" refers to the owner of the prototype, not the prototype itself if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) { @@ -84,13 +123,20 @@ exports.attachTo = function(parser) { if (!newDoclet.memberof && e.astnode) { var basename = null, scope = ''; - if ( /^((module.)?exports|this)(\.|$)/.test(newDoclet.name) ) { + if ( moduleRegExp.test(newDoclet.name) ) { var nameStartsWith = RegExp.$1; - newDoclet.name = newDoclet.name.replace(/^(exports|this)(\.|$)/, ''); + // 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; - if (nameStartsWith === 'exports' && currentModule) { + // 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'; } @@ -101,8 +147,8 @@ exports.attachTo = function(parser) { else { // like /** @module foo */ exports = {bar: 1}; // or /** blah */ this.foo = 1; - memberofName = this.resolveThis(e.astnode); - scope = nameStartsWith === 'exports'? 'static' : 'instance'; + memberofName = parser.resolveThis(e.astnode); + scope = nameStartsWith === 'exports' ? 'static' : 'instance'; // like /** @module foo */ this.bar = 1; if (nameStartsWith === 'this' && currentModule && !memberofName) { @@ -113,13 +159,14 @@ exports.attachTo = function(parser) { if (memberofName) { if (newDoclet.name) { - newDoclet.name = memberofName + (scope === 'instance'? '#' : '.') + newDoclet.name; + newDoclet.name = memberofName + (scope === 'instance' ? '#' : '.') + + newDoclet.name; } else { newDoclet.name = memberofName; } } } else { - memberofName = this.astnodeToMemberof(e.astnode); + memberofName = parser.astnodeToMemberof(e.astnode); if( Array.isArray(memberofName) ) { basename = memberofName[1]; memberofName = memberofName[0]; @@ -129,21 +176,12 @@ exports.attachTo = function(parser) { if (memberofName) { newDoclet.addTag('memberof', memberofName); if (basename) { - newDoclet.name = newDoclet.name.replace(new RegExp('^' + RegExp.escape(basename) + '.'), ''); + newDoclet.name = (newDoclet.name || '') + .replace(new RegExp('^' + RegExp.escape(basename) + '.'), ''); } } else { - // add @inner and @memberof tags unless the current module exports only this symbol - if (currentModule && currentModule !== newDoclet.name) { - // add @inner unless the current module exports only this symbol - if (!newDoclet.scope) { - newDoclet.addTag('inner'); - } - - if (!newDoclet.memberof && newDoclet.scope !== 'global') { - newDoclet.addTag('memberof', currentModule); - } - } + setDefaultScopeMemberOf(newDoclet); } } @@ -153,48 +191,41 @@ exports.attachTo = function(parser) { return false; } - //resolveProperties(newDoclet); - // 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(this, newDoclet); + addDoclet.call(parser, newDoclet); e.doclet = newDoclet; } - //parser.on('fileBegin', function(e) { }); + // handles JSDoc comments that include a @name tag -- the code is ignored in such a case + parser.on('jsdocCommentFound', function(e) { + var newDoclet = getNewDoclet(e.comment, e); + + if (!newDoclet.name) { + return false; // only interested in virtual comments (with a @name) here + } + + 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 + parser.on('symbolFound', function(e) { + var subDoclets = e.comment.split(/@also\b/g); + + for (var i = 0, l = subDoclets.length; i < l; i++) { + newSymbolDoclet.call(parser, subDoclets[i], e); + } + }); parser.on('fileComplete', function(e) { currentModule = null; }); - - function addDoclet(newDoclet) { - var e; - if (newDoclet) { - e = { doclet: newDoclet }; - this.emit('newDoclet', e); - - if ( !e.defaultPrevented && !filter(newDoclet) ) { - this.addResult(newDoclet); - } - } - } - - function filter(doclet) { - // you can't document prototypes - if ( /#$/.test(doclet.longname) ) { - return true; - } - // you can't document symbols added by the parser with a dummy name - if (doclet.meta.code && doclet.meta.code.name === '____') { - return true; - } - - return false; - } - - function resolveProperties(newDoclet) {} }; diff --git a/node_modules/jsdoc/lib/jsdoc/src/parser.js b/node_modules/jsdoc/lib/jsdoc/src/parser.js index f22797e..121bf0f 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/parser.js +++ b/node_modules/jsdoc/lib/jsdoc/src/parser.js @@ -1,57 +1,138 @@ -/*global env: true, Packages: true */ +/*global env, Packages */ +/*eslint no-script-url:0 */ /** * @module jsdoc/src/parser - * @requires fs - * @requires events */ +'use strict'; + +var jsdoc = { + doclet: require('jsdoc/doclet'), + name: require('jsdoc/name'), + src: { + astnode: require('jsdoc/src/astnode'), + syntax: require('jsdoc/src/syntax') + } +}; +var logger = require('jsdoc/util/logger'); +var util = require('util'); -var Token = Packages.org.mozilla.javascript.Token; 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; +} + +// 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'; + } + + if (PARSERS[type]) { + modulePath = PARSERS[type]; + } + else { + modulePath = path.join( path.getResourcePath(path.dirname(type)), path.basename(type) ); + } + + try { + return new ( require(modulePath) ).Parser(); + } + catch (e) { + logger.fatal('Unable to create the parser type "' + type + '": ' + e); + } +}; + +// TODO: docs /** * @class - * @mixes module:events + * @mixes module:events.EventEmitter * * @example Create a new parser. * var jsdocParser = new (require('jsdoc/src/parser').Parser)(); */ -exports.Parser = function() { - this._currentSourceName = ''; - this._resultBuffer = []; - this._comments = { - original: [], - modified: [] - }; - //Initialize a global ref to store global members - this.refs = { - __global__: { - meta: {} - } - }; - this._visitors = []; -}; -exports.Parser.prototype = Object.create( require('events').EventEmitter.prototype ); +var Parser = exports.Parser = function(builderInstance, visitorInstance, walkerInstance) { + this.clear(); + this._astBuilder = builderInstance || new (require('jsdoc/src/astbuilder')).AstBuilder(); + this._visitor = visitorInstance || new (require('jsdoc/src/visitor')).Visitor(this); + this._walker = walkerInstance || new (require('jsdoc/src/walker')).Walker(); + + Object.defineProperties(this, { + astBuilder: { + get: function() { + return this._astBuilder; + } + }, + visitor: { + get: function() { + return this._visitor; + } + }, + walker: { + get: function() { + return this._walker; + } + } + }); +}; +util.inherits(Parser, require('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 = {}; +}; + +// TODO: update docs /** * Parse the given source files for JSDoc comments. * @param {Array.} sourceFiles An array of filepaths to the JavaScript sources. * @param {string} [encoding=utf8] * - * @fires jsdocCommentFound - * @fires symbolFound - * @fires newDoclet - * @fires fileBegin - * @fires fileComplete + * @fires module:jsdoc/src/parser.Parser.parseBegin + * @fires module:jsdoc/src/parser.Parser.fileBegin + * @fires module:jsdoc/src/parser.Parser.jsdocCommentFound + * @fires module:jsdoc/src/parser.Parser.symbolFound + * @fires module:jsdoc/src/parser.Parser.newDoclet + * @fires module:jsdoc/src/parser.Parser.fileComplete + * @fires module:jsdoc/src/parser.Parser.parseComplete * * @example Parse two source files. * var myFiles = ['file1.js', 'file2.js']; * var docs = jsdocParser.parse(myFiles); */ -exports.Parser.prototype.parse = function(sourceFiles, encoding) { +Parser.prototype.parse = function(sourceFiles, encoding) { encoding = encoding || env.conf.encoding || 'utf8'; - const SCHEMA = 'javascript:'; - var filename = ''; var sourceCode = ''; var parsedFiles = []; @@ -62,6 +143,7 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) { } e.sourcefiles = sourceFiles; + logger.debug('Parsing source files: %j', sourceFiles); this.emit('parseBegin', e); @@ -78,9 +160,7 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) { sourceCode = require('jsdoc/fs').readFileSync(filename, encoding); } catch(e) { - console.log('FILE READ ERROR: in module:jsdoc/parser.parseFiles: "' + filename + - '" ' + e); - continue; + logger.error('Unable to read and parse the source file %s: %s', filename, e); } } @@ -94,462 +174,62 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) { sourcefiles: parsedFiles, doclets: this._resultBuffer }); + logger.debug('Finished parsing source files.'); return this._resultBuffer; }; -exports.Parser.prototype.fireProcessingComplete = function(doclets) { +// TODO: docs +Parser.prototype.fireProcessingComplete = function(doclets) { this.emit('processingComplete', { doclets: doclets }); }; -/** - * @returns {Array} The accumulated results of any calls to parse. - */ -exports.Parser.prototype.results = function() { +// TODO: docs +Parser.prototype.results = function() { return this._resultBuffer; }; +// TODO: update docs /** * @param {Object} o The parse result to add to the result buffer. */ -exports.Parser.prototype.addResult = function(o) { +Parser.prototype.addResult = function(o) { this._resultBuffer.push(o); }; -/** - * Empty any accumulated results of calls to parse. - */ -exports.Parser.prototype.clear = function() { - this._currentSourceName = ''; - this._resultBuffer = []; - this._comments = { - original: [], - modified: [] - }; +// TODO: docs +Parser.prototype.addAstNodeVisitor = function(visitor) { + this._visitor.addAstNodeVisitor(visitor); }; -/** - * Adds a node visitor to use in parsing - */ -exports.Parser.prototype.addNodeVisitor = function(visitor) { - this._visitors.push(visitor); -}; - -/** - * Get the node visitors used in parsing - */ -exports.Parser.prototype.getVisitors = function() { - return this._visitors; +// TODO: docs +Parser.prototype.getAstNodeVisitors = function() { + return this._visitor.getAstNodeVisitors(); }; +// TODO: docs function pretreat(code) { return code // comment out hashbang at the top of the file, like: #!/usr/bin/env node - .replace(/^(\#\![\S \t]+\n)/, '// $1') + .replace(/^(\#\![\S \t]+\r?\n)/, '// $1') - // make starbangstar comments look like real jsdoc comments + // to support code minifiers that preserve /*! comments, treat /*!* as equivalent to /** .replace(/\/\*\!\*/g, '/**') - // merge adjacent doclets - .replace(/\*\/\/\*\*+/g, '@also') - // make lent object literals documentable by giving them a dummy name - // like return @lends { - .replace(/(\/\*\*[^\*\/]*?[\*\s]*@lends\s(?:[^\*]|\*(?!\/))*\*\/\s*)\{/g, '$1 ____ = {') - // like @lends return { - .replace(/(\/\*\*[^\*\/]*?@lends\b[^\*\/]*?\*\/)(\s*)return(\s*)\{/g, - '$2$3 return $1 ____ = {'); + .replace(/\*\/\/\*\*+/g, '@also'); } -var tkn = { - NAMEDFUNCTIONSTATEMENT: -1001 -}; -exports.Parser.tkn = tkn; - /** @private */ -function parserFactory() { - var cx = Packages.org.mozilla.javascript.Context.getCurrentContext(); - - var ce = new Packages.org.mozilla.javascript.CompilerEnvirons(); - ce.setRecordingComments(true); - ce.setRecordingLocalJsDocComments(true); - ce.setLanguageVersion(180); - - ce.initFromContext(cx); - return new Packages.org.mozilla.javascript.Parser(ce, ce.getErrorReporter()); -} - -/** @private - @memberof module:src/parser.Parser -*/ -function getTypeName(node) { - var type = ''; - - if (node) { - type = '' + Packages.org.mozilla.javascript.Token.typeToName(node.getType()); - } - - return type; -} - -/** @private - @memberof module:src/parser.Parser -*/ -function nodeToString(node) { - var str; - - if (!node) { - return; - } - - if (node.type === Token.GETPROP) { - str = [nodeToString(node.target), node.property.string].join('.'); - } - else if (node.type === Token.VAR) { - str = nodeToString(node.target); - } - else if (node.type === Token.NAME) { - str = node.string; - } - else if (node.type === Token.STRING) { - str = node.value; - } - else if (node.type === Token.NUMBER) { - str = node.value; - } - else if (node.type === Token.THIS) { - str = 'this'; - } - else if (node.type === Token.GETELEM) { - str = node.toSource(); // like: Foo['Bar'] - } - else if (node.type === Token.NEG || node.type === Token.TRUE || node.type === Token.FALSE) { - str = node.toSource(); // like -1 - } - else { - str = getTypeName(node); - } - - return '' + str; -} - -/** - * Attempts to find the name and type of the given node. - * @private - * @memberof module:src/parser.Parser - */ -function aboutNode(node) { - var about = {}; - - if (node.type == Token.FUNCTION || node.type == tkn.NAMEDFUNCTIONSTATEMENT) { - about.name = node.type == tkn.NAMEDFUNCTIONSTATEMENT? '' : '' + node.name; - about.type = 'function'; - about.node = node; - } - else if (node.type == Token.VAR || node.type == Token.LET || node.type == Token.CONST) { - about.name = nodeToString(node.target); - if (node.initializer) { // like var i = 0; - about.node = node.initializer; - about.value = nodeToString(about.node); - about.type = getTypeName(node.initializer); - if (about.type === 'FUNCTION' && about.node.name) { - about.node.type = tkn.NAMEDFUNCTIONSTATEMENT; - } - } - else { // like var i; - about.node = node.target; - about.value = nodeToString(about.node); - about.type = 'undefined'; - } - } - else if (node.type === Token.ASSIGN || node.type === Token.COLON || - node.type === Token.GET || node.type === Token.SET) { - about.name = nodeToString(node.left); - if (node.type === Token.COLON) { - - // objlit keys with unsafe variable-name characters must be quoted - if (!/^[$_a-z][$_a-z0-9]*$/i.test(about.name) ) { - about.name = '"'+about.name.replace(/"/g, '\\"')+'"'; - } - } - about.node = node.right; - about.value = nodeToString(about.node); - - // Getter and setter functions should be treated as properties - if (node.type === Token.GET || node.type === Token.SET) { - about.type = getTypeName(node); - } else { - about.type = getTypeName(node.right); - } - - if (about.type === 'FUNCTION' && about.node.name) { - about.node.type = tkn.NAMEDFUNCTIONSTATEMENT; - } - } - else if (node.type === Token.GETPROP) { - about.node = node; - about.name = nodeToString(about.node); - about.type = getTypeName(node); - } - else { - // type 39 (NAME) - var string = nodeToString(node); - if (string) { - about.name = string; - } - } - - // get names of the formal parameters declared for this function - if (about.node && about.node.getParamCount) { - var paramCount = about.node.getParamCount(); - if (typeof paramCount === 'number') { - about.node.flattenSymbolTable(true); - var paramNames = []; - for (var i = 0, l = paramCount; i < l; i++) { - paramNames.push( '' + about.node.getParamOrVarName(i) ); - } - about.paramnames = paramNames; - } - } - - return about; -} - -/** @private - @memberof module:src/parser.Parser -*/ -function isValidJsdoc(commentSrc) { - /*** ignore comments that start with many stars ***/ - return commentSrc && commentSrc.indexOf('/***') !== 0; -} - -/** @private - * @memberof module:src/parser.Parser - */ -function makeVarsFinisher(funcDoc) { - return function(e) { - //no need to evaluate all things related to funcDoc again, just use it - if (funcDoc && e.doclet && e.doclet.alias) { - funcDoc.meta.vars[e.code.name] = e.doclet.longname; - } - }; -} - -/** @private - * @memberof module:src/parser.Parser - * @param {string} name Full symbol name. - * @return {string} Basename. - */ -function getBasename(name) { - if (name !== undefined) { - return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1'); - } - return name; -} - -/** @private - * @memberof module:src/parser.Parser - * @param {object} node - * @return {Array.} Start and end lines. - */ -function getRange(node) { - var range = []; - - range[0] = parseInt(String(node.getAbsolutePosition()), 10); - range[1] = range[0] + parseInt(String(node.getLength()), 10); - - return range; -} - -/** @private - * @memberof module:src/parser.Parser - */ -exports.Parser.prototype._makeEvent = function(node, extras) { - extras = extras || {}; - - // fill in default values as needed. if we're overriding a property, don't execute the default - // code for that property, since it might blow up. - var result = { - id: extras.id || 'astnode' + node.hashCode(), - comment: extras.comment || String(node.getJsDoc() || '@undocumented'), - lineno: extras.lineno || node.left.getLineno(), - range: extras.range || getRange(node), - filename: extras.filename || this._currentSourceName, - astnode: extras.astnode || node, - code: extras.code || aboutNode(node), - event: extras.event || 'symbolFound', - finishers: extras.finishers || [this.addDocletRef] - }; - - // use the modified version of the comment - var idx = this._comments.original.indexOf(result.comment); - if (idx !== -1) { - result.comment = this._comments.modified[idx]; - } - - // make sure the result includes extras that don't have default values - for (var prop in extras) { - if ( hasOwnProp.call(extras, prop) ) { - result[prop] = extras[prop]; - } - } - - return result; -}; - -/** @private - * @memberof module:src/parser.Parser - */ -exports.Parser.prototype._trackVars = function(node, e) { - // keep track of vars in a function or global scope - var func = '__global__'; - var funcDoc = null; - - if (node.enclosingFunction) { - func = 'astnode' + node.enclosingFunction.hashCode(); - } - - funcDoc = this.refs[func]; - if (funcDoc) { - funcDoc.meta.vars = funcDoc.meta.vars || {}; - funcDoc.meta.vars[e.code.name] = false; - e.finishers.push(makeVarsFinisher(funcDoc)); - } -}; - -/** @private */ -exports.Parser.prototype._visitComment = function(comment) { - var e; - var original = String( comment.toSource() ); - var modified; - - if ( original && isValidJsdoc(original) ) { - this._comments.original.push(original); - - e = { - comment: original, - lineno: comment.getLineno(), - filename: this._currentSourceName, - range: getRange(comment) - }; - - this.emit('jsdocCommentFound', e, this); - - if (e.comment !== original) { - modified = e.comment; - } - - this._comments.modified.push(modified || original); - } - - return true; -}; - -/** @private */ -exports.Parser.prototype._visitNode = function(node) { - var e, - extras, - basename, - func, - funcDoc, - i, - l; - - if (node.type === Token.ASSIGN) { - e = this._makeEvent(node); - - basename = getBasename(e.code.name); - - if (basename !== 'this') { - e.code.funcscope = this.resolveVar(node, basename); - } - } - else if (node.type === Token.COLON) { // assignment within an object literal - extras = { - comment: String(node.left.getJsDoc() || '@undocumented'), - finishers: [this.addDocletRef, this.resolveEnum] - }; - e = this._makeEvent(node, extras); - } - else if (node.type === Token.GET || node.type === Token.SET) { // assignment within an object literal - extras = { - comment: String(node.left.getJsDoc() || '@undocumented') - }; - e = this._makeEvent(node, extras); - } - else if (node.type === Token.GETPROP) { // like 'obj.prop' in '/** @typedef {string} */ obj.prop;' - // this COULD be a Closure Compiler-style typedef, but it's probably not; to avoid filling - // the parse results with junk, only fire an event if there's a JSDoc comment attached - extras = { - lineno: node.getLineno() - }; - if ( node.getJsDoc() ) { - e = this._makeEvent(node, extras); - } - } - else if (node.type == Token.VAR || node.type == Token.LET || node.type == Token.CONST) { - - if (node.variables) { - return true; // we'll get each var separately on future visits - } - - if (node.parent.variables.toArray()[0] === node) { // like /** blah */ var a=1, b=2, c=3; - // the first var assignment gets any jsDoc before the whole var series - if (typeof node.setJsDoc !== 'undefined') { node.setJsDoc( node.parent.getJsDoc() ); } - } - - extras = { - lineno: node.getLineno() - }; - e = this._makeEvent(node, extras); - - this._trackVars(node, e); - } - else if (node.type == Token.FUNCTION || node.type == tkn.NAMEDFUNCTIONSTATEMENT) { - extras = { - lineno: node.getLineno() - }; - e = this._makeEvent(node, extras); - - e.code.name = (node.type == tkn.NAMEDFUNCTIONSTATEMENT)? '' : String(node.name) || ''; - - this._trackVars(node, e); - - basename = getBasename(e.code.name); - e.code.funcscope = this.resolveVar(node, basename); - } - - if (!e) { - e = { - finishers: [] - }; - } - - for (i = 0, l = this._visitors.length; i < l; i++) { - this._visitors[i].visitNode(node, e, this, this._currentSourceName); - if (e.stopPropagation) { break; } - } - - if (!e.preventDefault && isValidJsdoc(e.comment)) { - this.emit(e.event, e, this); - } - - for (i = 0, l = e.finishers.length; i < l; i++) { - e.finishers[i].call(this, e); - } - - return true; -}; - -/** @private */ -exports.Parser.prototype._parseSourceCode = function(sourceCode, sourceName) { - var NodeVisitor = Packages.org.mozilla.javascript.ast.NodeVisitor; - +Parser.prototype._parseSourceCode = function(sourceCode, sourceName) { var ast; + var globalScope; + var e = { filename: sourceName }; this.emit('fileBegin', e); + logger.printInfo('Parsing %s ...', sourceName); if (!e.defaultPrevented) { e = { @@ -558,239 +238,263 @@ exports.Parser.prototype._parseSourceCode = function(sourceCode, sourceName) { }; this.emit('beforeParse', e); sourceCode = e.source; - this._currentSourceName = sourceName = e.filename; + sourceName = e.filename; sourceCode = pretreat(e.source); - ast = parserFactory().parse(sourceCode, sourceName, 1); + ast = this._astBuilder.build(sourceCode, sourceName); + if (ast) { + this._walker.recurse(sourceName, ast, this._visitor); + } - ast.visitComments( - new NodeVisitor({ - visit: this._visitComment.bind(this) - }) - ); - - ast.visit( - new NodeVisitor({ - visit: this._visitNode.bind(this) - }) - ); } this.emit('fileComplete', e); - - this._currentSourceName = ''; + logger.info('complete.'); }; +// TODO: docs +Parser.prototype.addDocletRef = function(e) { + var node; + + if (e && e.code && e.code.node) { + node = e.code.node; + // allow lookup from value => doclet + if (e.doclet) { + this.refs[node.nodeId] = e.doclet; + } + // keep references to undocumented anonymous functions, too, as they might have scoped vars + else if ( + (node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression) && + !this.refs[node.nodeId] ) { + this.refs[node.nodeId] = { + longname: jsdoc.name.ANONYMOUS_LONGNAME, + meta: { + code: e.code + } + }; + } + } +}; + +// TODO: docs +Parser.prototype._getDoclet = function(id) { + if ( hasOwnProp.call(this.refs, id) ) { + return this.refs[id]; + } + + return null; +}; + +// TODO: docs +/** + * @param {string} name - The symbol's longname. + * @return {string} The symbol's basename. + */ +Parser.prototype.getBasename = function(name) { + if (name !== undefined) { + return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1'); + } +}; + +// TODO: docs +function definedInScope(doclet, basename) { + return !!doclet && !!doclet.meta && !!doclet.meta.vars && !!basename && + hasOwnProp.call(doclet.meta.vars, basename); +} + +// TODO: docs /** * Given a node, determine what the node is a member of. - * @param {astnode} node + * @param {node} node * @returns {string} The long name of the node that this is a member of. */ -exports.Parser.prototype.astnodeToMemberof = function(node) { - var id, - doclet, - alias; +Parser.prototype.astnodeToMemberof = function(node) { + var basename; + var doclet; + var scope; - if (node.type === Token.VAR || node.type === Token.FUNCTION || - node.type == tkn.NAMEDFUNCTIONSTATEMENT) { - if (node.enclosingFunction) { // an inner var or func - id = 'astnode' + node.enclosingFunction.hashCode(); - doclet = this.refs[id]; - if (!doclet) { - return '~'; - } - return (doclet.longname || doclet.name) + '~'; + var result = ''; + var type = node.type; + + if ( (type === Syntax.FunctionDeclaration || type === Syntax.FunctionExpression || + type === Syntax.VariableDeclarator) && node.enclosingScope ) { + doclet = this._getDoclet(node.enclosingScope.nodeId); + + if (!doclet) { + result = jsdoc.name.ANONYMOUS_LONGNAME + jsdoc.name.INNER; + } + else { + result = (doclet.longname || doclet.name) + jsdoc.name.INNER; } } else { // check local references for aliases - var scope = node, - basename = getBasename(nodeToString(node.left)); - while(scope.enclosingFunction) { - id = 'astnode' + scope.enclosingFunction.hashCode(); - doclet = this.refs[id]; - if (doclet && doclet.meta.vars && basename in doclet.meta.vars) { - alias = hasOwnProp.call(doclet.meta.vars, basename) ? - doclet.meta.vars[basename] : false; - if (alias !== false) { - return [alias, basename]; - } - } - // move up - scope = scope.enclosingFunction; - } - // First check to see if we have a global scope alias - doclet = this.refs.__global__; - if ( doclet && doclet.meta.vars && hasOwnProp.call(doclet.meta.vars, basename) ) { - alias = doclet.meta.vars[basename]; - if (alias !== false) { - return [alias, basename]; - } - } + scope = node; + basename = this.getBasename( jsdoc.src.astnode.nodeToString(node) ); - id = 'astnode' + node.parent.hashCode(); - doclet = this.refs[id]; - if (!doclet) { - return ''; // global? - } - return doclet.longname || doclet.name; - } -}; - -/** - * Resolve what "this" refers to relative to a node. - * @param {astnode} node - The "this" node - * @returns {string} The longname of the enclosing node. - */ -exports.Parser.prototype.resolveThis = function(node) { - var memberof = {}; - var parent; - - if (node.type !== Token.COLON && node.enclosingFunction) { - // get documentation for the enclosing function - memberof.id = 'astnode' + node.enclosingFunction.hashCode(); - memberof.doclet = this.refs[memberof.id]; - - if (!memberof.doclet) { - return ''; // TODO handle global this? - } - - if (memberof.doclet['this']) { - return memberof.doclet['this']; - } - // like: Foo.constructor = function(n) { /** blah */ this.name = n; } - else if (memberof.doclet.kind === 'function' && memberof.doclet.memberof) { - return memberof.doclet.memberof; - } - // walk up to the closest class we can find - else if (memberof.doclet.kind === 'class' || memberof.doclet.kind === 'module') { - return memberof.doclet.longname || memberof.doclet.name; - } - else { - if (node.enclosingFunction){ - // memberof.doclet.meta.code.val - return this.resolveThis(node.enclosingFunction); + // walk up the scope chain until we find the scope in which the node is defined + while (scope.enclosingScope) { + doclet = this._getDoclet(scope.enclosingScope.nodeId); + if ( doclet && definedInScope(doclet, basename) ) { + result = [doclet.meta.vars[basename], basename]; + break; } else { - return ''; // TODO handle global this? + // move up + scope = scope.enclosingScope; } } + + // do we know that it's a global? + doclet = this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID]; + if ( doclet && definedInScope(doclet, basename) ) { + result = [doclet.meta.vars[basename], basename]; + } + + // have we seen the node's parent? if so, use that + else if (node.parent) { + doclet = this._getDoclet(node.parent.nodeId); + + // set the result if we found a doclet. (if we didn't, the AST node may describe a + // global symbol.) + if (doclet) { + result = doclet.longname || doclet.name; + } + } + } + + return result; +}; + +// TODO: docs +/** + * Resolve what "this" refers to relative to a node. + * @param {node} node - The "this" node + * @returns {string} The longname of the enclosing node. + */ +Parser.prototype.resolveThis = function(node) { + var doclet; + 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. + if (node.type !== Syntax.Property && node.enclosingScope) { + doclet = this._getDoclet(node.enclosingScope.nodeId); + + if (!doclet) { + result = jsdoc.name.ANONYMOUS_LONGNAME; // TODO handle global this? + } + else if (doclet['this']) { + result = doclet['this']; + } + // like: Foo.constructor = function(n) { /** blah */ this.name = n; } + else if (doclet.kind === 'function' && doclet.memberof) { + result = doclet.memberof; + } + // like: var foo = function(n) { /** blah */ this.bar = n; } + else if ( doclet.kind === 'member' && jsdoc.src.astnode.isAssignment(node) ) { + result = doclet.longname || doclet.name; + } + // walk up to the closest class we can find + else if (doclet.kind === 'class' || doclet.kind === 'module') { + result = doclet.longname || doclet.name; + } + else if (node.enclosingScope) { + result = this.resolveThis(node.enclosingScope); + } } else if (node.parent) { - if (node.parent.type === Token.COLON) { - parent = node.parent.parent; + doclet = this.refs[node.parent.nodeId]; + + // TODO: is this behavior correct? when do we get here? + if (!doclet) { + result = ''; // global? } else { - parent = node.parent; + result = doclet.longname || doclet.name; } - - memberof.id = 'astnode' + parent.hashCode(); - memberof.doclet = this.refs[memberof.id]; - - if (!memberof.doclet) { - return ''; // global? - } - - return memberof.doclet.longname || memberof.doclet.name; } + // TODO: is this behavior correct? when do we get here? else { - return ''; // global? + result = ''; // global? } + + return result; }; +// TODO: docs /** * Given 'var foo = { x: 1 }', find foo from x. */ -exports.Parser.prototype.resolvePropertyParent = function(node) { - var memberof = {}; - var parent; +Parser.prototype.resolvePropertyParent = function(node) { + var doclet; - if (node.parent && node.parent.type === Token.COLON) { - parent = node.parent.parent; - } - else { - parent = node.parent; + if (node.parent) { + doclet = this._getDoclet(node.parent.nodeId); } - if (parent) { - memberof.id = 'astnode' + parent.hashCode(); - memberof.doclet = this.refs[memberof.id]; - - if (memberof.doclet) { - return memberof; - } - } + return doclet; }; +// TODO docs /** * Resolve what function a var is limited to. * @param {astnode} node * @param {string} basename The leftmost name in the long name: in foo.bar.zip the basename is foo. */ -exports.Parser.prototype.resolveVar = function(node, basename) { +Parser.prototype.resolveVar = function(node, basename) { var doclet; - var enclosingFunction = node.enclosingFunction; + var result; - if (!enclosingFunction) { - return ''; // global + var scope = node.enclosingScope; + + if (!scope) { + result = ''; // global + } + else { + doclet = this._getDoclet(scope.nodeId); + if ( definedInScope(doclet, basename) ) { + result = doclet.longname; + } + else { + result = this.resolveVar(scope, basename); + } } - doclet = this.refs['astnode'+enclosingFunction.hashCode()]; - if (doclet && doclet.meta.vars && basename in doclet.meta.vars) { - return doclet.longname; - } - - return this.resolveVar(enclosingFunction, basename); + return result; }; -exports.Parser.prototype.addDocletRef = function(e) { - var node = e.code.node; - // allow lookup from value => doclet - if (e.doclet) { - this.refs['astnode' + node.hashCode()] = e.doclet; - } - // keep references to undocumented anonymous functions, too, as they might have scoped vars - else if ((node.type == Token.FUNCTION || node.type == tkn.NAMEDFUNCTIONSTATEMENT) && - !this.refs['astnode' + node.hashCode()]) { - this.refs['astnode' + node.hashCode()] = { - longname: '', - meta: { - code: e.code - } - }; - } -}; +// TODO: docs +Parser.prototype.resolveEnum = function(e) { + var doclet = this.resolvePropertyParent(e.code.node.parent); -exports.Parser.prototype.resolveEnum = function(e) { - var parent = this.resolvePropertyParent(e.code.node); - - if (parent && parent.doclet.isEnum) { - if (!parent.doclet.properties) { - parent.doclet.properties = []; + if (doclet && doclet.isEnum) { + if (!doclet.properties) { + doclet.properties = []; } // members of an enum inherit the enum's type - if (parent.doclet.type && !e.doclet.type) { - e.doclet.type = parent.doclet.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 the doclet to the parent's properties - // use a copy of the doclet to avoid circular references - parent.doclet.properties.push( require('jsdoc/util/doop').doop(e.doclet) ); + // 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 /** - Fired whenever the parser encounters a 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. -*/ \ No newline at end of file + * 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. + */ diff --git a/node_modules/jsdoc/lib/jsdoc/src/scanner.js b/node_modules/jsdoc/lib/jsdoc/src/scanner.js index 94d02af..a8170a7 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/scanner.js +++ b/node_modules/jsdoc/lib/jsdoc/src/scanner.js @@ -1,13 +1,15 @@ +/*global env: true */ /** @module jsdoc/src/scanner @requires module:fs - + @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ - +'use strict'; var fs = require('jsdoc/fs'); +var logger = require('jsdoc/util/logger'); var path = require('jsdoc/path'); /** @@ -24,33 +26,43 @@ exports.Scanner.prototype = Object.create( require('events').EventEmitter.protot @fires sourceFileFound */ exports.Scanner.prototype.scan = function(searchPaths, depth, filter) { - var pwd = process.env.PWD, - filePaths = [], - self = this; + var currentFile; + var isFile; + + var filePaths = []; + var pwd = env.pwd; + var self = this; searchPaths = searchPaths || []; depth = depth || 1; searchPaths.forEach(function($) { - var filepath = decodeURIComponent($); - if ( fs.statSync(filepath).isFile() ) { - filePaths.push( path.resolve(pwd, filepath) ); + var filepath = path.resolve( pwd, decodeURIComponent($) ); + + try { + currentFile = fs.statSync(filepath); + } + catch (e) { + logger.error('Unable to find the source file or directory %s', filepath); + return; + } + + if ( currentFile.isFile() ) { + filePaths.push(filepath); } else { - filePaths = filePaths.concat( fs.ls(filepath, depth).map(function(item) { - return path.resolve(pwd, item); - }) ); + filePaths = filePaths.concat( fs.ls(filepath, depth) ); } }); - + filePaths = filePaths.filter(function($) { return filter.isIncluded($); }); - + filePaths = filePaths.filter(function($) { var e = { fileName: $ }; self.emit('sourceFileFound', e); - + return !e.defaultPrevented; }); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/syntax.js b/node_modules/jsdoc/lib/jsdoc/src/syntax.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/syntax.js rename to node_modules/jsdoc/lib/jsdoc/src/syntax.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/visitor.js b/node_modules/jsdoc/lib/jsdoc/src/visitor.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/visitor.js rename to node_modules/jsdoc/lib/jsdoc/src/visitor.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/walker.js b/node_modules/jsdoc/lib/jsdoc/src/walker.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/src/walker.js rename to node_modules/jsdoc/lib/jsdoc/src/walker.js diff --git a/node_modules/jsdoc/lib/jsdoc/tag.js b/node_modules/jsdoc/lib/jsdoc/tag.js index ca59f95..142592a 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag.js +++ b/node_modules/jsdoc/lib/jsdoc/tag.js @@ -12,24 +12,42 @@ @requires jsdoc/tag/validator @requires jsdoc/tag/type */ +'use strict'; var jsdoc = { tag: { dictionary: require('jsdoc/tag/dictionary'), validator: require('jsdoc/tag/validator'), type: require('jsdoc/tag/type') + }, + util: { + logger: require('jsdoc/util/logger') } }; +var path = require('jsdoc/path'); -function trim(text, newlines) { - if (!text) { return ''; } - - if (newlines) { - return text.replace(/^[\n\r\f]+|[\n\r\f]+$/g, ''); +function trim(text, opts) { + var indentMatcher; + var match; + + opts = opts || {}; + text = text || ''; + + if (opts.keepsWhitespace) { + text = text.replace(/^[\n\r\f]+|[\n\r\f]+$/g, ''); + if (opts.removesIndent) { + match = text.match(/^([ \t]+)/); + if (match && match[1]) { + indentMatcher = new RegExp('^' + match[1], 'gm'); + text = text.replace(indentMatcher, ''); + } + } } else { - return text.replace(/^\s+|\s+$/g, ''); + text = text.replace(/^\s+|\s+$/g, ''); } + + return text; } function processTagText(tag, tagDef) { @@ -42,7 +60,7 @@ function processTagText(tag, tagDef) { if (tagDef.canHaveType || tagDef.canHaveName) { /** The value property represents the result of parsing the tag text. */ tag.value = {}; - + tagType = jsdoc.tag.type.parse(tag.text, tagDef.canHaveName, tagDef.canHaveType); // It is possible for a tag to *not* have a type but still have @@ -59,11 +77,11 @@ function processTagText(tag, tagDef) { tag.value.variable = tagType.variable; tag.value.defaultvalue = tagType.defaultvalue; } - + if (tagType.text && tagType.text.length) { tag.value.description = tagType.text; } - + if (tagDef.canHaveName) { // note the dash is a special case: as a param name it means "no name" if (tagType.name && tagType.name !== '-') { tag.value.name = tagType.name; } @@ -83,21 +101,40 @@ function processTagText(tag, tagDef) { @param {object=} meta */ var Tag = exports.Tag = function(tagTitle, tagBody, meta) { + var tagDef; + var trimOpts; + meta = meta || {}; - + this.originalTitle = trim(tagTitle); - + /** The title part of the tag: @title text */ this.title = jsdoc.tag.dictionary.normalise(this.originalTitle); - var tagDef = jsdoc.tag.dictionary.lookUp(this.title); - + tagDef = jsdoc.tag.dictionary.lookUp(this.title); + trimOpts = { + keepsWhitespace: tagDef.keepsWhitespace, + removesIndent: tagDef.removesIndent + }; + /** The text part of the tag: @title text */ - this.text = trim(tagBody, tagDef.keepsWhitespace); - + this.text = trim(tagBody, trimOpts); + if (this.text) { - processTagText(this, tagDef); + 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 + ); + } } - + 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 e87cc88..0a745b4 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js @@ -1,8 +1,9 @@ /** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @overview + @author Michael Mathews + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var hasOwnProp = Object.prototype.hasOwnProperty; @@ -11,14 +12,13 @@ var _tagSynonyms = {}; var _namespaces = []; var dictionary; - /** @private */ function TagDefinition(title, etc) { var self = this; etc = etc || {}; - + this.title = dictionary.normalise(title); - + Object.keys(etc).forEach(function(p) { self[p] = etc[p]; }); @@ -37,22 +37,22 @@ dictionary = { var def = new TagDefinition(title, opts); // all the other dictionary functions use normalised names; we should too. _tags[def.title] = def; - - if (opts.isNamespace) { + + if (opts && opts.isNamespace) { _namespaces.push(def.title); } - + return _tags[def.title]; }, /** @function */ lookUp: function(title) { title = dictionary.normalise(title); - + if ( hasOwnProp.call(_tags, title) ) { return _tags[title]; } - + return false; }, @@ -64,18 +64,18 @@ dictionary = { return true; } } - + return false; }, - + /** @function */ normalise: function(title) { var canonicalName = title.toLowerCase(); - + if ( hasOwnProp.call(_tagSynonyms, canonicalName) ) { return _tagSynonyms[canonicalName]; } - + return canonicalName; } }; diff --git a/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js b/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js index b37e075..66a3813 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js @@ -1,4 +1,4 @@ -/*global app: true, env: true */ +/*global app, env */ /** Define tags that are known in JSDoc. @module jsdoc/tag/dictionary/definitions @@ -6,13 +6,52 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; +var hasOwnProp = Object.prototype.hasOwnProperty; +var jsdoc = { + name: require('jsdoc/name'), + src: { + astnode: require('jsdoc/src/astnode') + }, + tag: { + type: require('jsdoc/tag/type') + }, + util: { + 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; + +function getSourcePaths() { + var sourcePaths = env.sourceFiles.slice(0) || []; + + if (env.opts._) { + env.opts._.forEach(function(sourcePath) { + var resolved = path.resolve(env.pwd, sourcePath); + if (sourcePaths.indexOf(resolved) === -1) { + sourcePaths.push(resolved); + } + }); + } + + return sourcePaths; +} function filepathMinusPrefix(filepath) { - var sourceFiles = env.sourceFiles || []; - var commonPrefix = path.commonPrefix( sourceFiles.concat(env.opts._ || []) ); - var result = (filepath + '/').replace(commonPrefix, ''); + var sourcePaths = getSourcePaths(); + var commonPrefix = path.commonPrefix(sourcePaths); + var result = ''; + + if (filepath) { + // always use forward slashes + result = (filepath + path.sep).replace(commonPrefix, '') + .replace(/\\/g, '/'); + } if (result.length > 0 && result[result.length - 1] !== '/') { result += '/'; @@ -27,7 +66,12 @@ function setDocletKindToTitle(doclet, tag) { } function setDocletScopeToTitle(doclet, tag) { - doclet.addTag( 'scope', tag.title ); + try { + doclet.setScope(tag.title); + } + catch(e) { + jsdoc.util.logger.error(e.message); + } } function setDocletNameToValue(doclet, tag) { @@ -39,12 +83,30 @@ function setDocletNameToValue(doclet, tag) { } } +function setDocletNameToValueName(doclet, tag) { + if (tag.value && tag.value.name) { + doclet.addTag('name', tag.value.name); + } +} + function setDocletDescriptionToValue(doclet, tag) { if (tag.value) { doclet.addTag( 'description', tag.value ); } } +function setDocletTypeToValueType(doclet, tag) { + if (tag.value && tag.value.type) { + // Add the type names and other type properties (such as `optional`). + // Don't overwrite existing properties. + Object.keys(tag.value).forEach(function(prop) { + if ( !hasOwnProp.call(doclet, prop) ) { + doclet[prop] = tag.value[prop]; + } + }); + } +} + function setNameToFile(doclet, tag) { var name; @@ -68,7 +130,7 @@ function applyNamespace(docletOrNs, tag) { if (!docletOrNs.name) { return; // error? } - + //doclet.displayname = doclet.name; docletOrNs.longname = app.jsdoc.name.applyNamespace(docletOrNs.name, tag.title); } @@ -109,7 +171,7 @@ function firstWordOf(string) { @param {module:jsdoc/tag/dictionary} dictionary */ exports.defineTags = function(dictionary) { - + dictionary.defineTag('abstract', { mustNotHaveValue: true, onTagged: function(doclet, tag) { @@ -118,7 +180,7 @@ exports.defineTags = function(dictionary) { } }) .synonym('virtual'); - + dictionary.defineTag('access', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -131,29 +193,39 @@ exports.defineTags = function(dictionary) { } } }); - + dictionary.defineTag('alias', { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.alias = tag.value; } }); - - dictionary.defineTag('author', { - mustHaveValue: true, + + // 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. + // *//** + // * Foo with a param. + // * @param {string} bar + // */ + // function foo(bar) {} + dictionary.defineTag('also', { onTagged: function(doclet, tag) { - if (!doclet.author) { doclet.author = []; } - doclet.author.push(tag.value); + // let the parser handle it; we define the tag here to avoid "not a known tag" errors } }); - - // I add on to that + + // this symbol inherits from the specified symbol dictionary.defineTag('augments', { mustHaveValue: true, // Allow augments value to be specified as a normal type, e.g. {Type} onTagText: function(text) { - var type = require('jsdoc/tag/type'), - tagType = type.parse(text, false, true); + + var tagType = jsdoc.tag.type.parse(text, false, true); return tagType.typeExpression || text; }, onTagged: function(doclet, tag) { @@ -161,8 +233,16 @@ exports.defineTags = function(dictionary) { } }) .synonym('extends'); - - // that adds on to me + + dictionary.defineTag('author', { + mustHaveValue: true, + onTagged: function(doclet, tag) { + if (!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', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -170,20 +250,11 @@ exports.defineTags = function(dictionary) { doclet.borrow(borrows.target, borrows.source); } }); - - // that adds all of it's members to me - dictionary.defineTag('mixes', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - var source = firstWordOf(tag.value); - doclet.mix(source); - } - }); - + dictionary.defineTag('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? @@ -192,37 +263,29 @@ exports.defineTags = function(dictionary) { return; } } - + setDocletNameToValue(doclet, tag); } }) .synonym('constructor'); - + dictionary.defineTag('classdesc', { onTagged: function(doclet, tag) { doclet.classdesc = tag.value; } }); - + dictionary.defineTag('constant', { canHaveType: true, + canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); - if (tag.value && tag.value.type) { - doclet.type = tag.value.type; - } + setDocletNameToValueName(doclet, tag); + setDocletTypeToValueType(doclet, tag); } }) .synonym('const'); - - dictionary.defineTag('copyright', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - doclet.copyright = tag.value; - } - }); - + dictionary.defineTag('constructs', { onTagged: function(doclet, tag) { var ownerClassName; @@ -237,57 +300,72 @@ exports.defineTags = function(dictionary) { } }); + dictionary.defineTag('copyright', { + mustHaveValue: true, + onTagged: function(doclet, tag) { + doclet.copyright = tag.value; + } + }); + dictionary.defineTag('default', { onTagged: function(doclet, tag) { + var type; + var value; + + var nodeToString = jsdoc.src.astnode.nodeToString; + if (tag.value) { doclet.defaultvalue = tag.value; } - else if (doclet.meta && doclet.meta.code && typeof doclet.meta.code.value !== 'undefined') { - if (doclet.meta.code.type && /STRING|NUMBER|NAME|TRUE|FALSE/.test(doclet.meta.code.type)) { - doclet.defaultvalue = doclet.meta.code.value; - if (doclet.meta.code.type === 'STRING') { - // TODO: handle escaped quotes in values - doclet.defaultvalue = '"'+doclet.defaultvalue.replace(/"/g, '\\"')+'"'; - } - - if (doclet.defaultvalue === 'TRUE' || doclet.defaultvalue == 'FALSE') { - doclet.defaultvalue = doclet.defaultvalue.toLowerCase(); - } - } - else if (doclet.meta.code.type === 'NULL') { - // TODO: handle escaped quotes in values - doclet.defaultvalue = 'null'; - } - else if (doclet.meta.code.type === 'OBJECTLIT') { - doclet.defaultvalue = String(doclet.meta.code.node.toSource()); - doclet.defaultvaluetype = 'object'; + else if (doclet.meta && doclet.meta.code && doclet.meta.code.value) { + type = doclet.meta.code.type; + value = doclet.meta.code.value; + + switch(type) { + case Syntax.ArrayExpression: + doclet.defaultvalue = nodeToString(doclet.meta.code.node); + doclet.defaultvaluetype = 'array'; + break; + + case Syntax.Literal: + doclet.defaultvalue = String(value); + break; + + case Syntax.ObjectExpression: + doclet.defaultvalue = nodeToString(doclet.meta.code.node); + doclet.defaultvaluetype = 'object'; + break; + + default: + // do nothing + break; } } } }) .synonym('defaultvalue'); - + dictionary.defineTag('deprecated', { // value is optional onTagged: function(doclet, tag) { doclet.deprecated = tag.value || true; } }); - + dictionary.defineTag('description', { mustHaveValue: true }) .synonym('desc'); - + dictionary.defineTag('enum', { canHaveType: true, onTagged: function(doclet, tag) { doclet.kind = 'member'; doclet.isEnum = true; - if (tag.value && tag.value.type) { doclet.type = tag.value.type; } + setDocletTypeToValueType(doclet, tag); } }); - + dictionary.defineTag('event', { isNamespace: true, onTagged: function(doclet, tag) { @@ -295,64 +373,55 @@ exports.defineTags = function(dictionary) { setDocletNameToValue(doclet, tag); } }); - + dictionary.defineTag('example', { keepsWhitespace: true, + removesIndent: true, mustHaveValue: true, onTagged: function(doclet, tag) { if (!doclet.examples) { doclet.examples = []; } doclet.examples.push(tag.value); } }); - - dictionary.defineTag('exception', { + + dictionary.defineTag('exports', { mustHaveValue: true, - canHaveType: true, onTagged: function(doclet, tag) { - if (!doclet.exceptions) { doclet.exceptions = []; } - doclet.exceptions.push(tag.value); - if (tag.value && tag.value.type) { - doclet.type = tag.value.type; - } - } - }) - .synonym('throws'); - + var modName = firstWordOf(tag.value); + + doclet.addTag('alias', modName); + doclet.addTag('kind', 'module'); + } + }); + dictionary.defineTag('external', { canHaveType: true, isNamespace: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); if (tag.value && tag.value.type) { - doclet.type = tag.value.type; + setDocletTypeToValueType(doclet, tag); + doclet.addTag('name', doclet.type.names[0]); + } + else { + setDocletNameToValue(doclet, tag); } } }) .synonym('host'); - - dictionary.defineTag('exports', { - mustHaveValue: true, - onTagged: function(doclet, tag) { - var modName = firstWordOf(tag.value); - - doclet.addTag('alias', modName); - doclet.addTag('kind', 'module'); - } - }); - + dictionary.defineTag('file', { onTagged: function(doclet, tag) { setNameToFile(doclet, tag); setDocletKindToTitle(doclet, tag); setDocletDescriptionToValue(doclet, tag); - + doclet.preserveName = true; } }) .synonym('fileoverview') .synonym('overview'); - + dictionary.defineTag('fires', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -362,7 +431,7 @@ exports.defineTags = function(dictionary) { } }) .synonym('emits'); - + dictionary.defineTag('function', { onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); @@ -371,7 +440,7 @@ exports.defineTags = function(dictionary) { }) .synonym('func') .synonym('method'); - + dictionary.defineTag('global', { mustNotHaveValue: true, onTagged: function(doclet, tag) { @@ -379,37 +448,37 @@ exports.defineTags = function(dictionary) { delete doclet.memberof; } }); - + dictionary.defineTag('ignore', { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.ignore = true; } }); - + dictionary.defineTag('inner', { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } }); - + dictionary.defineTag('instance', { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } }); - + dictionary.defineTag('kind', { mustHaveValue: true }); - + dictionary.defineTag('lends', { onTagged: function(doclet, tag) { - doclet.alias = tag.value || ''; + doclet.alias = tag.value || GLOBAL_LONGNAME; doclet.addTag('undocumented'); } }); - + dictionary.defineTag('license', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -426,25 +495,24 @@ exports.defineTags = function(dictionary) { // TODO: verify that parameters match the event parameters? } }); - + dictionary.defineTag('member', { canHaveType: true, + canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); - setDocletNameToValue(doclet, tag); - if (tag.value && tag.value.type) { - doclet.type = tag.value.type; - } + setDocletNameToValueName(doclet, tag); + setDocletTypeToValueType(doclet, tag); } }) .synonym('var'); - + dictionary.defineTag('memberof', { mustHaveValue: true, onTagged: function(doclet, tag) { if (tag.originalTitle === 'memberof!') { doclet.forceMemberof = true; - if (tag.value === '') { + if (tag.value === GLOBAL_LONGNAME) { doclet.addTag('global'); delete doclet.memberof; } @@ -453,14 +521,23 @@ exports.defineTags = function(dictionary) { } }) .synonym('memberof!'); - + + // this symbol mixes in all of the specified object's members + dictionary.defineTag('mixes', { + mustHaveValue: true, + onTagged: function(doclet, tag) { + var source = firstWordOf(tag.value); + doclet.mix(source); + } + }); + dictionary.defineTag('mixin', { onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); } }); - + dictionary.defineTag('module', { canHaveType: true, isNamespace: true, @@ -470,46 +547,42 @@ exports.defineTags = function(dictionary) { if (!doclet.name) { setDocletNameToFilename(doclet, tag); } - if (tag.value && tag.value.type) { - doclet.type = tag.value.type; - } + setDocletTypeToValueType(doclet, tag); } }); - + dictionary.defineTag('name', { mustHaveValue: true }); - + dictionary.defineTag('namespace', { canHaveType: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); - if (tag.value && tag.value.type) { - doclet.type = tag.value.type; - } + setDocletTypeToValueType(doclet, tag); } }); - + dictionary.defineTag('param', { //mustHaveValue: true, // param name can be found in the source code if not provided canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { if (!doclet.params) { doclet.params = []; } - doclet.params.push(tag.value||{}); + doclet.params.push(tag.value || {}); } }) .synonym('argument') .synonym('arg'); - + dictionary.defineTag('private', { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.access = 'private'; } }); - + dictionary.defineTag('property', { mustHaveValue: true, canHaveType: true, @@ -520,21 +593,21 @@ exports.defineTags = function(dictionary) { } }) .synonym('prop'); - + dictionary.defineTag('protected', { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.access = 'protected'; } }); - + dictionary.defineTag('public', { mustNotHaveValue: true, onTagged: function(doclet, tag) { delete doclet.access; // public is default } }); - + // use this instead of old deprecated @final tag dictionary.defineTag('readonly', { mustNotHaveValue: true, @@ -542,21 +615,21 @@ exports.defineTags = function(dictionary) { doclet.readonly = true; } }); - + dictionary.defineTag('requires', { mustHaveValue: true, onTagged: function(doclet, tag) { var requiresName; - // inline link tags are passed through as-is so that `@requires {@link foo}` works + // inline link tags are passed through as-is so that `@requires {@link foo}` works if ( require('jsdoc/tag/inline').isInlineTag(tag.value, 'link\\S*') ) { requiresName = tag.value; } // otherwise, assume it's a module else { requiresName = firstWordOf(tag.value); - if (requiresName.indexOf('module:') !== 0) { - requiresName = 'module:' + requiresName; + if (requiresName.indexOf(MODULE_PREFIX) !== 0) { + requiresName = MODULE_PREFIX + requiresName; } } @@ -564,7 +637,7 @@ exports.defineTags = function(dictionary) { doclet.requires.push(requiresName); } }); - + dictionary.defineTag('returns', { mustHaveValue: true, canHaveType: true, @@ -574,7 +647,7 @@ exports.defineTags = function(dictionary) { } }) .synonym('return'); - + dictionary.defineTag('see', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -582,35 +655,34 @@ exports.defineTags = function(dictionary) { doclet.see.push(tag.value); } }); - + dictionary.defineTag('since', { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.since = tag.value; } }); - + dictionary.defineTag('static', { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } }); - + dictionary.defineTag('summary', { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.summary = tag.value; } }); - + dictionary.defineTag('this', { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.see) { doclet.see = []; } doclet['this'] = firstWordOf(tag.value); } }); - + dictionary.defineTag('todo', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -618,7 +690,18 @@ exports.defineTags = function(dictionary) { doclet.todo.push(tag.value); } }); - + + dictionary.defineTag('throws', { + mustHaveValue: true, + canHaveType: true, + onTagged: function(doclet, tag) { + if (!doclet.exceptions) { doclet.exceptions = []; } + doclet.exceptions.push(tag.value); + setDocletTypeToValueType(doclet, tag); + } + }) + .synonym('exception'); + dictionary.defineTag('tutorial', { mustHaveValue: true, onTagged: function(doclet, tag) { @@ -626,22 +709,36 @@ exports.defineTags = function(dictionary) { doclet.tutorials.push(tag.value); } }); - + dictionary.defineTag('type', { mustHaveValue: true, + mustNotHaveDescription: true, canHaveType: true, onTagText: function(text) { - // remove line breaks so we can parse the type expression correctly - text = text.replace(/[\n\r]/g, ''); - // any text must be formatted as a type, but for back compat braces are optional - if ( !/^\{[\s\S]+\}$/.test(text) ) { - text = '{' + text + '}'; + var closeIdx; + var openIdx; + + var OPEN_BRACE = '{'; + var CLOSE_BRACE = '}'; + + // remove line breaks + text = text.replace(/[\f\n\r]/g, ''); + + // Text must be a type expression; for backwards compatibility, we add braces if they're + // missing. But do NOT add braces to things like `@type {string} some pointless text`. + openIdx = text.indexOf(OPEN_BRACE); + closeIdx = text.indexOf(CLOSE_BRACE); + + // a type expression is at least one character long + if ( openIdx !== 0 || closeIdx <= openIdx + 1) { + text = OPEN_BRACE + text + CLOSE_BRACE; } + return text; }, onTagged: function(doclet, tag) { if (tag.value && tag.value.type) { - doclet.type = tag.value.type; + setDocletTypeToValueType(doclet, tag); // for backwards compatibility, we allow @type for functions to imply return type if (doclet.kind === 'function') { @@ -650,17 +747,15 @@ exports.defineTags = function(dictionary) { } } }); - + dictionary.defineTag('typedef', { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); - + if (tag.value) { - if (tag.value.name) { - doclet.addTag('name', tag.value.name); - } + setDocletNameToValueName(doclet, tag); // callbacks are always type {function} if (tag.originalTitle === 'callback') { @@ -670,14 +765,14 @@ exports.defineTags = function(dictionary) { ] }; } - else if (tag.value.type) { - doclet.type = tag.value.type; + else { + setDocletTypeToValueType(doclet, tag); } } } }) .synonym('callback'); - + dictionary.defineTag('undocumented', { mustNotHaveValue: true, onTagged: function(doclet, tag) { @@ -685,14 +780,14 @@ exports.defineTags = function(dictionary) { doclet.comment = ''; } }); - + dictionary.defineTag('variation', { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.variation = tag.value; } }); - + dictionary.defineTag('version', { mustHaveValue: true, onTagged: function(doclet, tag) { diff --git a/node_modules/jsdoc/lib/jsdoc/tag/inline.js b/node_modules/jsdoc/lib/jsdoc/tag/inline.js index c25ab4d..e05c40f 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/inline.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/inline.js @@ -1,9 +1,10 @@ /** * @module jsdoc/tag/inline - * + * * @author Jeff Williams * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; /** * Information about an inline tag that was found within a string. @@ -65,12 +66,7 @@ function regExpFactory(tagName, prefix, suffix) { * cases. */ exports.isInlineTag = function(string, tagName) { - try { - return regExpFactory(tagName, '^', '$').test(string); - } - catch(e) { - return false; - } + return regExpFactory(tagName, '^', '$').test(string); }; /** @@ -94,7 +90,7 @@ exports.replaceInlineTags = function(string, replacers) { }; tagInfo.push(matchedTag); - return replacer.call(this, string, matchedTag); + return replacer(string, matchedTag); } string = string || ''; @@ -106,7 +102,7 @@ exports.replaceInlineTags = function(string, replacers) { string = replaceMatch(replacers[replacer], replacer, matches[0], matches[1]); } }); - + return { tags: tagInfo, newString: string.trim() diff --git a/node_modules/jsdoc/lib/jsdoc/tag/type.js b/node_modules/jsdoc/lib/jsdoc/tag/type.js index e2d384a..b0ca81f 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/type.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/type.js @@ -1,17 +1,20 @@ /** * @module jsdoc/tag/type - * + * * @author Michael Mathews * @author Jeff Williams * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; +var catharsis = require('catharsis'); var jsdoc = { name: require('jsdoc/name'), tag: { inline: require('jsdoc/tag/inline') } }; +var util = require('util'); /** * Information about a type expression extracted from tag text. @@ -36,8 +39,6 @@ function unescapeBraces(text) { * @return {module:jsdoc/tag/type.TypeExpressionInfo} The type expression and updated tag text. */ function extractTypeExpression(string) { - string = string || ''; - var completeExpression; var count = 0; var position = 0; @@ -98,7 +99,7 @@ function getTagInfo(tagValue, canHaveName, canHaveType) { typeExpression = expressionAndText.expression; text = expressionAndText.newString; } - + if (canHaveName) { nameAndDescription = jsdoc.name.splitName(text); name = nameAndDescription.name; @@ -109,11 +110,11 @@ function getTagInfo(tagValue, canHaveName, canHaveType) { if (canHaveType) { typeOverride = jsdoc.tag.inline.extractInlineTag(text, 'type'); if (typeOverride.tags && typeOverride.tags[0]) { - typeExpression = typeOverride.tags[0].text || typeExpression; + typeExpression = typeOverride.tags[0].text; } text = typeOverride.newString; } - + return { name: name, typeExpression: typeExpression, @@ -145,7 +146,7 @@ function getTagInfo(tagValue, canHaveName, canHaveType) { /** * Extract JSDoc-style type information from the name specified in the tag info, including the * member name; whether the member is optional; and the default value of the member. - * + * * @private * @param {module:jsdoc/tag/type.TagInfo} tagInfo - Information contained in the tag. * @return {module:jsdoc/tag/type.TagInfo} Updated information from the tag. @@ -155,24 +156,25 @@ function parseName(tagInfo) { if ( /^\[\s*(.+?)\s*\]$/.test(tagInfo.name) ) { tagInfo.name = RegExp.$1; tagInfo.optional = true; - + // like 'foo=bar' or 'foo = bar' if ( /^(.+?)\s*=\s*(.+)$/.test(tagInfo.name) ) { tagInfo.name = RegExp.$1; tagInfo.defaultvalue = RegExp.$2; } } - + return tagInfo; } /** @private */ -function getTypeStrings(parsedType) { +function getTypeStrings(parsedType, isOutermostType) { + var applications; + var typeString; + var types = []; - var catharsis = require('catharsis'); var TYPES = catharsis.Types; - var util = require('util'); switch(parsedType.type) { case TYPES.AllLiteral: @@ -191,7 +193,19 @@ function getTypeStrings(parsedType) { types.push('Object'); break; case TYPES.TypeApplication: - types.push( catharsis.stringify(parsedType) ); + // 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); + }).join(', '); + typeString = util.format( '%s.<%s>', getTypeStrings(parsedType.expression), + applications ); + + types.push(typeString); + } + else { + types.push( catharsis.stringify(parsedType) ); + } break; case TYPES.TypeUnion: parsedType.elements.forEach(function(element) { @@ -222,9 +236,6 @@ function getTypeStrings(parsedType) { * @return {module:jsdoc/tag/type.TagInfo} Updated information from the tag. */ function parseTypeExpression(tagInfo) { - var catharsis = require('catharsis'); - var util = require('util'); - var errorMessage; var parsedType; @@ -232,30 +243,28 @@ function parseTypeExpression(tagInfo) { if (!tagInfo.typeExpression) { return tagInfo; } - + try { parsedType = catharsis.parse(tagInfo.typeExpression, {jsdoc: true}); } catch (e) { // always re-throw so the caller has a chance to report which file was bad - throw new Error( util.format('unable to parse the type expression "%s": %s', - tagInfo.typeExpression, e.message) ); + throw new Error( util.format('Invalid type expression "%s": %s', tagInfo.typeExpression, + e.message) ); } - if (parsedType) { - tagInfo.type = tagInfo.type.concat( getTypeStrings(parsedType) ); + tagInfo.type = tagInfo.type.concat( getTypeStrings(parsedType, true) ); - // Catharsis and JSDoc use the same names for 'optional' and 'nullable'... - ['optional', 'nullable'].forEach(function(key) { - if (parsedType[key] !== null && parsedType[key] !== undefined) { - tagInfo[key] = parsedType[key]; - } - }); - - // ...but not 'variable'. - if (parsedType.repeatable !== null && parsedType.repeatable !== undefined) { - tagInfo.variable = parsedType.repeatable; + // Catharsis and JSDoc use the same names for 'optional' and 'nullable'... + ['optional', 'nullable'].forEach(function(key) { + if (parsedType[key] !== null && parsedType[key] !== undefined) { + tagInfo[key] = parsedType[key]; } + }); + + // ...but not 'variable'. + if (parsedType.repeatable !== null && parsedType.repeatable !== undefined) { + tagInfo.variable = parsedType.repeatable; } return tagInfo; @@ -277,10 +286,10 @@ var typeParsers = [parseName, parseTypeExpression]; */ exports.parse = function(tagValue, canHaveName, canHaveType) { if (typeof tagValue !== 'string') { tagValue = ''; } - + var tagInfo = getTagInfo(tagValue, canHaveName, canHaveType); tagInfo.type = tagInfo.type || []; - + typeParsers.forEach(function(parser) { tagInfo = parser.call(this, tagInfo); }); diff --git a/node_modules/jsdoc/lib/jsdoc/tag/validator.js b/node_modules/jsdoc/lib/jsdoc/tag/validator.js index 5621cce..3d9103c 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/validator.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/validator.js @@ -1,15 +1,16 @@ /*global env: true */ /** - @module jsdoc/tag/validator - @requires jsdoc/tag/dictionary + @module jsdoc/tag/validator + @requires jsdoc/tag/dictionary - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. + @author Michael Mathews + @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ - +'use strict'; var dictionary = require('jsdoc/tag/dictionary'); var format = require('util').format; +var logger = require('jsdoc/util/logger'); function buildMessage(tagName, meta, desc) { var result = format('The @%s tag %s. File: %s, line: %s', tagName, desc, meta.filename, @@ -20,43 +21,25 @@ function buildMessage(tagName, meta, desc) { return result; } -function UnknownTagError(tagName, meta) { - this.name = 'UnknownTagError'; - this.message = buildMessage(tagName, meta, 'is not a known tag'); -} -UnknownTagError.prototype = new Error(); -UnknownTagError.prototype.constructor = UnknownTagError; - -function TagValueRequiredError(tagName, meta) { - this.name = 'TagValueRequiredError'; - this.message = buildMessage(tagName, meta, 'requires a value'); -} -TagValueRequiredError.prototype = new Error(); -TagValueRequiredError.prototype.constructor = TagValueRequiredError; - -function TagValueNotPermittedError(tagName, meta) { - this.name = 'TagValueNotPermittedError'; - this.message = buildMessage(tagName, meta, 'does not permit a value'); -} -TagValueNotPermittedError.prototype = new Error(); -TagValueNotPermittedError.prototype.constructor = TagValueNotPermittedError; - /** * Validate the given tag. */ exports.validate = function(tag, tagDef, meta) { + // check for errors that make the tag useless if (!tagDef && !env.conf.tags.allowUnknownTags) { - require('jsdoc/util/error').handle( new UnknownTagError(tag.title, meta) ); + logger.error( buildMessage(tag.title, meta, 'is not a known tag') ); } - - if (!tag.text) { - if (tagDef.mustHaveValue) { - require('jsdoc/util/error').handle( new TagValueRequiredError(tag.title, meta) ); - } + else if (!tag.text && tagDef.mustHaveValue) { + logger.error( buildMessage(tag.title, meta, 'requires a value') ); } - else { - if (tagDef.mustNotHaveValue) { - require('jsdoc/util/error').handle( new TagValueNotPermittedError(tag.title, meta) ); - } + + // check for minor issues that are usually harmless + else if (tag.text && tagDef.mustNotHaveValue) { + logger.warn( buildMessage(tag.title, meta, + 'does not permit a value; the value will be ignored') ); + } + else if (tag.value && tag.value.description && tagDef.mustNotHaveDescription) { + logger.warn( buildMessage(tag.title, meta, + 'does not permit a description; the description will be ignored') ); } }; diff --git a/node_modules/jsdoc/lib/jsdoc/template.js b/node_modules/jsdoc/lib/jsdoc/template.js index 3fb2e76..b5317c9 100644 --- a/node_modules/jsdoc/lib/jsdoc/template.js +++ b/node_modules/jsdoc/lib/jsdoc/template.js @@ -4,12 +4,12 @@ * @author Matthew Christopher Kastor-Inare III * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var _ = require('underscore'), fs = require('jsdoc/fs'), path = require('path'); - /** @module jsdoc/template */ @@ -37,21 +37,21 @@ exports.Template = function(path) { @return {function} Returns template closure. */ exports.Template.prototype.load = function(file) { - var _path = path.join(this.path, file); - return _.template(fs.readFileSync(_path, 'utf8'), null, this.settings); + return _.template(fs.readFileSync(file, 'utf8'), null, this.settings); }; - /** Renders template using given data. - + This is low-level function, for rendering full templates use {@link Template.render()}. - + @param {string} file - Template filename. @param {object} data - Template variables (doesn't have to be object, but passing variables dictionary is best way and most common use). @return {string} Rendered template. */ exports.Template.prototype.partial = function(file, data) { + file = path.resolve(this.path, file); + // load template into cache if (!(file in this.cache)) { this.cache[file] = this.load(file); @@ -63,9 +63,9 @@ exports.Template.prototype.partial = function(file, data) { /** Renders template with given data. - + This method automaticaly applies layout if set. - + @param {string} file - Template filename. @param {object} data - Template variables (doesn't have to be object, but passing variables dictionary is best way and most common use). @return {string} Rendered template. diff --git a/node_modules/jsdoc/lib/jsdoc/tutorial.js b/node_modules/jsdoc/lib/jsdoc/tutorial.js index 81ef5b5..a20b9c7 100644 --- a/node_modules/jsdoc/lib/jsdoc/tutorial.js +++ b/node_modules/jsdoc/lib/jsdoc/tutorial.js @@ -3,6 +3,7 @@ @author Rafał Wrzeszcz @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var markdown = require('jsdoc/util/markdown'); @@ -13,7 +14,7 @@ var markdown = require('jsdoc/util/markdown'); */ function removeChild(parent, child) { var index = parent.children.indexOf(child); - if (index != -1) { + if (index !== -1) { parent.children.splice(index, 1); } } diff --git a/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js b/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js index c07a3f7..7c446e2 100644 --- a/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js +++ b/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js @@ -8,15 +8,18 @@ /** @module jsdoc/tutorial/resolver */ +'use strict'; -var tutorial = require('jsdoc/tutorial'), - fs = require('jsdoc/fs'), - error = require('jsdoc/util/error'), - path = require('path'), - hasOwnProp = Object.prototype.hasOwnProperty, - conf = {}, - tutorials = {}, - finder = /^(.*)\.(x(?:ht)?ml|html?|md|markdown|json)$/i; +var logger = require('jsdoc/util/logger'); +var fs = require('jsdoc/fs'); +var path = require('path'); +var tutorial = require('jsdoc/tutorial'); + +var hasOwnProp = Object.prototype.hasOwnProperty; + +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'. @@ -60,7 +63,7 @@ function addTutorialConf(name, meta) { } // check if the tutorial has already been defined... if (hasOwnProp.call(conf, name)) { - error.handle(new Error("Tutorial " + name + "'s metadata is defined multiple times, only the first will be used.")); + logger.warn('Metadata for the tutorial %s is defined more than once. Only the first definition will be used.', name ); } else { conf[name] = meta; } @@ -78,7 +81,7 @@ function addTutorialConf(name, meta) { */ exports.addTutorial = function(current) { if (hasOwnProp.call(tutorials, current.name)) { - error.handle(new Error("Tutorial with name " + current.name + " exists more than once, not adding (same name, different file extensions?)")); + logger.warn('The tutorial %s is defined more than once. Only the first definition will be used.', current.name); } else { tutorials[current.name] = current; @@ -178,7 +181,7 @@ exports.resolve = function() { if (item.children) { item.children.forEach(function(child) { if (!hasOwnProp.call(tutorials, child)) { - error.handle( new Error("Missing child tutorial: " + child) ); + logger.error('Missing child tutorial: %s', child); } else { tutorials[child].setParent(current); diff --git a/node_modules/jsdoc/lib/jsdoc/util/doop.js b/node_modules/jsdoc/lib/jsdoc/util/doop.js index d3c148c..a9e1468 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/doop.js +++ b/node_modules/jsdoc/lib/jsdoc/util/doop.js @@ -2,19 +2,37 @@ Deep clone a simple object. @private */ -var doop = exports.doop = function(o) { - var clone, - prop; +'use strict'; - if (o instanceof Object && o.constructor != Function) { - clone = o instanceof Array ? [] : {}; - - Object.keys(o).forEach(function(prop) { - clone[prop] = (o[prop] instanceof Object) ? doop(o[prop]) : o[prop]; - }); +function doop(o) { + var clone; + var props; + var i; + var l; + + 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]; + } + } + 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])); + } + } return clone; } - + return o; -}; +} + +// for backwards compatibility +doop.doop = doop; + +module.exports = doop; diff --git a/node_modules/jsdoc/lib/jsdoc/util/dumper.js b/node_modules/jsdoc/lib/jsdoc/util/dumper.js index e22279d..3d9c667 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/dumper.js +++ b/node_modules/jsdoc/lib/jsdoc/util/dumper.js @@ -1,59 +1,92 @@ +/*global Set */ /** * Recursively print out all names and values in a data structure. * @module jsdoc/util/dumper * @author Michael Mathews * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var util = require('util'); +var setDefined = typeof Set !== 'undefined'; -var seenItems = []; -function seen(object) { - if (seenItems.indexOf(object) !== -1) { - return true; +function ObjectWalker() { + if (setDefined) { + this.seenItems = new Set(); + } else { + this.seenItems = []; } - - return false; } +ObjectWalker.prototype.seen = function(object) { + var result; + if (setDefined) { + result = this.seenItems.has(object); + } else { + result = object.hasBeenSeenByWalkerDumper; + } + return result; +}; + +ObjectWalker.prototype.markAsSeen = function(object) { + if (setDefined) { + this.seenItems.add(object); + } else { + object.hasBeenSeenByWalkerDumper = true; + this.seenItems.push(object); + } +}; + +ObjectWalker.prototype.cleanSeenFlag = function() { + if (setDefined) { + this.seenItems = new Set(); + } else { + this.seenItems.forEach(function(object) { + delete object.hasBeenSeenByWalkerDumper; + }); + } +}; + // some objects are unwalkable, like Java native objects -function isUnwalkable(o) { +ObjectWalker.prototype.isUnwalkable = function(o) { return (o && typeof o === 'object' && typeof o.constructor === 'undefined'); -} +}; -function isFunction(o) { +ObjectWalker.prototype.isFunction = function(o) { return (o && typeof o === 'function' || o instanceof Function); -} +}; -function isObject(o) { +ObjectWalker.prototype.isObject = function(o) { return o && o instanceof Object || (o && typeof o.constructor !== 'undefined' && o.constructor.name === 'Object'); -} +}; -function checkCircularRefs(o, func) { - if ( seen(o) ) { +ObjectWalker.prototype.checkCircularRefs = function(o, func) { + if ( this.seen(o) ) { return ''; } else { - seenItems.push(o); - return func.call(this, o); + this.markAsSeen(o); + return func(o); } -} +}; -function walk(o) { +ObjectWalker.prototype.walk = function(o) { var result; - if ( isUnwalkable(o) ) { + var self = this; + + if ( this.isUnwalkable(o) ) { result = ''; } else if ( o === undefined ) { - result = 'undefined'; + result = null; } else if ( Array.isArray(o) ) { - result = checkCircularRefs(o, function(arr) { + result = this.checkCircularRefs(o, function(arr) { var newArray = []; arr.forEach(function(item) { - newArray.push( walk(item) ); + newArray.push( self.walk(item) ); }); return newArray; @@ -65,14 +98,18 @@ function walk(o) { else if ( util.isDate(o) ) { result = ''; } - else if ( isFunction(o) ) { + else if ( util.isError(o) ) { + result = { message: o.message }; + } + else if ( this.isFunction(o) ) { result = ''; } - else if ( isObject(o) && o !== null ) { - result = checkCircularRefs(o, function(obj) { + else if ( this.isObject(o) && o !== null ) { + result = this.checkCircularRefs(o, function(obj) { var newObj = {}; Object.keys(obj).forEach(function(key) { - newObj[key] = walk(obj[key]); + if (!setDefined && key === 'hasBeenSeenByWalkerDumper') { return; } + newObj[key] = self.walk(obj[key]); }); return newObj; @@ -82,13 +119,17 @@ function walk(o) { else { result = o; } - + return result; -} +}; /** * @param {*} object */ exports.dump = function(object) { - return JSON.stringify(walk(object), null, 4); + var walker = new ObjectWalker(); + var result = JSON.stringify(walker.walk(object), null, 4); + walker.cleanSeenFlag(); + + return result; }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/error.js b/node_modules/jsdoc/lib/jsdoc/util/error.js index 57d950b..6ed1895 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/error.js +++ b/node_modules/jsdoc/lib/jsdoc/util/error.js @@ -1,32 +1,35 @@ /*global env: true */ /** - Helper functions for handling errors. - @module jsdoc/util/error + * Helper functions for handling errors. + * + * @deprecated As of JSDoc 3.3.0. This module may be removed in a future release. Use the module + * {@link module:jsdoc/util/logger} to log warnings and errors. + * @module jsdoc/util/error */ +'use strict'; /** - Handle an exception appropriately based on whether lenient mode is enabled: - - + If lenient mode is enabled, log the exception to the console. - + If lenient mode is not enabled, re-throw the exception. - @param {Error} e - The exception to handle. - @exception {Error} Re-throws the original exception unless lenient mode is enabled. - @memberof module:jsdoc/util/error + * Log an exception as an error. + * + * Prior to JSDoc 3.3.0, this method would either log the exception (if lenient mode was enabled) or + * re-throw the exception (default). + * + * In JSDoc 3.3.0 and later, lenient mode has been replaced with strict mode, which is disabled by + * default. If strict mode is enabled, calling the `handle` method causes JSDoc to exit immediately, + * just as if the exception had been re-thrown. + * + * @deprecated As of JSDoc 3.3.0. This module may be removed in a future release. + * @param {Error} e - The exception to log. + * @memberof module:jsdoc/util/error */ exports.handle = function(e) { - var msg; + var logger = require('jsdoc/util/logger'); + var msg = e ? ( e.message || JSON.stringify(e) ) : ''; - if (env.opts.lenient) { - msg = e.message || JSON.stringify(e); + // include the error type if it's an Error object + if (e instanceof Error) { + msg = e.name + ': ' + msg; + } - // include the error type if it's an Error object - if (e instanceof Error) { - msg = e.name + ': ' + msg; - } - - console.log(msg); - } - else { - throw e; - } + logger.error(msg); }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/global.js b/node_modules/jsdoc/lib/jsdoc/util/global.js deleted file mode 100644 index dc20169..0000000 --- a/node_modules/jsdoc/lib/jsdoc/util/global.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * The global object to which functions and properties can be assigned. - * @private - */ -module.exports = (function() { - return this; -}).call(null); diff --git a/node_modules/jsdoc/lib/jsdoc/util/include.js b/node_modules/jsdoc/lib/jsdoc/util/include.js deleted file mode 100644 index 54d1efa..0000000 --- a/node_modules/jsdoc/lib/jsdoc/util/include.js +++ /dev/null @@ -1,19 +0,0 @@ -var path = require('path'); -var vm = require('jsdoc/util/vm'); - -/** - * Read and execute a JavaScript file in global scope. - * @private - * @param {string} filepath The path to the JavaScript file. May contain an absolute path or a - * path relative to env.dirname. - */ -module.exports = function(filepath) { - filepath = path.resolve(__dirname, filepath); - - try { - vm.getModule('jsdoc/util/include')(filepath); - } - catch (e) { - console.log('Cannot include ' + filepath + ': ' + e); - } -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/logger.js b/node_modules/jsdoc/lib/jsdoc/util/logger.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/logger.js rename to node_modules/jsdoc/lib/jsdoc/util/logger.js diff --git a/node_modules/jsdoc/lib/jsdoc/util/markdown.js b/node_modules/jsdoc/lib/jsdoc/util/markdown.js index af14a58..4f2e198 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/markdown.js +++ b/node_modules/jsdoc/lib/jsdoc/util/markdown.js @@ -1,4 +1,4 @@ -/*global env: true */ +/*global env */ /** * Provides access to Markdown-related functions. @@ -6,6 +6,9 @@ * @author Michael Mathews * @author Ben Blank */ +'use strict'; + +var util = require('util'); /** * Enumeration of Markdown parsers that are available. @@ -17,16 +20,16 @@ var parserNames = { * * @deprecated Replaced by "marked," as markdown-js does not support inline HTML. */ - evilstreak: "marked", + evilstreak: 'marked', /** * The "GitHub-flavored Markdown" parser. * @deprecated Replaced by "marked." */ - gfm: "marked", + gfm: 'marked', /** * The "[Marked](https://github.com/chjj/marked)" parser. */ - marked: "marked" + marked: 'marked' }; /** @@ -43,6 +46,38 @@ function escapeUnderscores(source) { }); } +/** + * Escape HTTP/HTTPS URLs so that they are not automatically converted to HTML links. + * + * @param {string} source - The source text to escape. + * @return {string} The source text with escape characters added to HTTP/HTTPS URLs. + */ +function escapeUrls(source) { + return source.replace(/(https?)\:\/\//g, '$1:\\/\\/'); +} + +/** + * Unescape HTTP/HTTPS URLs after Markdown parsing is complete. + * + * @param {string} source - The source text to unescape. + * @return {string} The source text with escape characters removed from HTTP/HTTPS URLs. + */ +function unescapeUrls(source) { + return source.replace(/(https?)\:\\\/\\\//g, '$1://'); +} + +/** + * Escape characters in text within a code block. + * + * @param {string} source - The source text to escape. + * @return {string} The escaped source text. + */ +function escapeCode(source) { + return source.replace(/%s', level, text, level); + }; + + // Allow prettyprint to work on inline code samples + markedRenderer.code = function(code, language) { + var langClass = language ? ' lang-' + language : ''; + + return util.format( '
            %s
            ', + langClass, escapeCode(code) ); + }; + parserFunction = function(source) { + var result; + source = escapeUnderscores(source); - return marked(source) + source = escapeUrls(source); + + result = marked(source, { renderer: markedRenderer }) .replace(/\s+$/, '') .replace(/'/g, "'"); + result = unescapeUrls(result); + + return result; }; parserFunction._parser = parserNames.marked; return parserFunction; } else { - throw new Error("unknown Markdown parser: '" + parserName + "'"); + logger.error('Unrecognized Markdown parser "%s". Markdown support is disabled.', + parserName); } } @@ -80,9 +140,9 @@ function getParseFunction(parserName, conf) { * `env.conf.markdown` property. The parsing function accepts a single parameter containing Markdown * source. The function uses the parser specified in `conf.json` to transform the Markdown source to * HTML, then returns the HTML as a string. - * @returns {Function} A function that accepts Markdown source, feeds it to the selected parser, and + * + * @returns {function} A function that accepts Markdown source, feeds it to the selected parser, and * returns the resulting HTML. - * @throws {Error} If the value of `env.conf.markdown.parser` does not correspond to a known parser. */ exports.getParser = function() { var conf = env.conf.markdown; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/runtime.js b/node_modules/jsdoc/lib/jsdoc/util/runtime.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/lib/jsdoc/util/runtime.js rename to node_modules/jsdoc/lib/jsdoc/util/runtime.js diff --git a/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js b/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js index c14f33c..709cd2f 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js +++ b/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js @@ -2,6 +2,7 @@ /** * @module jsdoc/util/templateHelper */ +'use strict'; var dictionary = require('jsdoc/tag/dictionary'); var util = require('util'); @@ -24,7 +25,7 @@ exports.setTutorials = function(root) { exports.globalName = 'global'; exports.fileExtension = '.html'; -exports.scopeToPunc = { 'static': '.', 'inner': '~', 'instance': '#' }; +exports.scopeToPunc = require('jsdoc/name').scopeToPunc; function getNamespace(kind) { if (dictionary.isNamespace(kind)) { @@ -55,6 +56,7 @@ 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, '-') @@ -65,7 +67,8 @@ function cleanseFilename(str) { } var htmlsafe = exports.htmlsafe = function(str) { - return str.replace(/ 0; +} + /** * Build an HTML link to the symbol with the specified longname. If the longname is not * associated with a URL, this method simply returns the link text, if provided, or the longname. @@ -182,7 +190,7 @@ function buildLink(longname, linkText, options) { } // handle complex type expressions that may require multiple links // (but skip anything that looks like an inline tag) - else if (longname && longname.search(/[<{(]/) !== -1 && /\{\@.+\}/.test(longname) === false) { + else if (longname && isComplexTypeExpression(longname) && /\{\@.+\}/.test(longname) === false) { parsedType = parseType(longname); return stringifyType(parsedType, options.cssClass, options.linkMap); } @@ -282,8 +290,8 @@ var tutorialToUrl = exports.tutorialToUrl = function(tutorial) { var node = tutorials.getByName(tutorial); // no such tutorial if (!node) { - require('jsdoc/util/error').handle( new Error('No such tutorial: '+tutorial) ); - return; + require('jsdoc/util/logger').error( new Error('No such tutorial: ' + tutorial) ); + return null; } var url; @@ -314,8 +322,8 @@ var tutorialToUrl = exports.tutorialToUrl = function(tutorial) { */ var toTutorial = exports.toTutorial = function(tutorial, content, missingOpts) { if (!tutorial) { - require('jsdoc/util/error').handle( new Error('Missing required parameter: tutorial') ); - return; + require('jsdoc/util/logger').error( new Error('Missing required parameter: tutorial') ); + return null; } var node = tutorials.getByName(tutorial); @@ -324,7 +332,7 @@ var toTutorial = exports.toTutorial = function(tutorial, content, missingOpts) { missingOpts = missingOpts || {}; var tag = missingOpts.tag; var classname = missingOpts.classname; - + var link = tutorial; if (missingOpts.prefix) { link = missingOpts.prefix + link; @@ -432,17 +440,19 @@ var find = exports.find = function(data, spec) { }; /** - * Check whether a symbol is a function and is the only symbol exported by a module (as in + * 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 a function and is the only symbol exported by a module; - * otherwise, `false`. + * @return {boolean} `true` if the symbol is the only symbol exported by a module; otherwise, + * `false`. */ -function isModuleFunction(doclet) { +function isModuleExports(doclet) { + var MODULE_PREFIX = require('jsdoc/name').MODULE_PREFIX; + return doclet.longname && doclet.longname === doclet.name && - doclet.longname.indexOf('module:') === 0 && doclet.kind === 'function'; + doclet.longname.indexOf(MODULE_PREFIX) === 0 && doclet.kind !== 'module'; } /** @@ -475,9 +485,9 @@ exports.getMembers = function(data) { // functions that are also modules (as in "module.exports = function() {};") are not globals members.globals = members.globals.filter(function(doclet) { - return !isModuleFunction(doclet); + return !isModuleExports(doclet); }); - + return members; }; @@ -489,31 +499,38 @@ exports.getMembers = function(data) { */ exports.getAttribs = function(d) { var attribs = []; - + if (d.virtual) { - attribs.push('virtual'); + attribs.push('abstract'); } - + if (d.access && d.access !== 'public') { attribs.push(d.access); } - + if (d.scope && d.scope !== 'instance' && d.scope !== 'global') { - if (d.kind == 'function' || d.kind == 'member' || d.kind == 'constant') { + if (d.kind === 'function' || d.kind === 'member' || d.kind === 'constant') { attribs.push(d.scope); } } - + if (d.readonly === true) { - if (d.kind == 'member') { + if (d.kind === 'member') { attribs.push('readonly'); } } - + if (d.kind === 'constant') { attribs.push('constant'); } + if (d.nullable === true) { + attribs.push('nullable'); + } + else if (d.nullable === false) { + attribs.push('non-null'); + } + return attribs; }; @@ -526,11 +543,11 @@ exports.getAttribs = function(d) { */ exports.getSignatureTypes = function(d, cssClass) { var types = []; - + if (d.type && d.type.names) { types = d.type.names; } - + if (types && types.length) { types = types.map(function(t) { return linkto(t, htmlsafe(t), cssClass); @@ -578,7 +595,7 @@ exports.getSignatureParams = function(d, optClass) { */ exports.getSignatureReturns = function(d, cssClass) { var returnTypes = []; - + if (d.returns) { d.returns.forEach(function(r) { if (r && r.type && r.type.names) { @@ -588,7 +605,7 @@ exports.getSignatureReturns = function(d, cssClass) { } }); } - + if (returnTypes && returnTypes.length) { returnTypes = returnTypes.map(function(r) { return linkto(r, htmlsafe(r), cssClass); @@ -710,8 +727,9 @@ exports.createLink = function(doclet) { var fakeContainer; var url = ''; + var INSTANCE = exports.scopeToPunc.instance; var longname = doclet.longname; - + // 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 // somehow has doclet.kind set to `member`). @@ -724,7 +742,7 @@ exports.createLink = function(doclet) { } // the doclet gets its own HTML file - if ( containers.indexOf(doclet.kind) !== -1 || isModuleFunction(doclet) ) { + if ( containers.indexOf(doclet.kind) !== -1 || isModuleExports(doclet) ) { filename = getFilename(longname); } // mistagged version of a doclet that gets its own HTML file @@ -743,7 +761,7 @@ exports.createLink = function(doclet) { fragment = getNamespace(doclet.kind) + (doclet.name || ''); } - url = fragment ? (filename + '#' + fragment) : filename; - + url = fragment ? (filename + INSTANCE + fragment) : filename; + return url; }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/vm.js b/node_modules/jsdoc/lib/jsdoc/util/vm.js deleted file mode 100644 index eb7048b..0000000 --- a/node_modules/jsdoc/lib/jsdoc/util/vm.js +++ /dev/null @@ -1,83 +0,0 @@ -/*global Packages: true */ -/** - * Helper functions to enable JSDoc to run on multiple JavaScript virtual machines. - * @module jsdoc/util/vm - */ - - var os = require('os'); - -// These strings represent directory names; do not modify them! -/** @private */ -const RHINO = exports.RHINO = 'rhino'; -/** @private */ -const NODEJS = exports.NODEJS = 'nodejs'; - -// hacky conversion from Windows path to URI -function pathToUri(filepath) { - var uri = filepath; - - // get drive - var drive = uri.match(/^[A-Za-z]/)[0] || ''; - // strip drive/colon (if present; UNC paths won't have either) - uri = uri.replace(/^:?([A-Za-z]\:)?/, ''); - // replace spaces with %20 - uri = uri.replace(/\s/g, '%20'); - // prepend drive (if present) - if (drive) { - uri = drive + ':' + uri; - } - // prepend URI scheme - uri = 'file:/' + uri; - - return uri; -} - -/** - * The JavaScript VM that is executing JSDoc: - * - * + `module:jsdoc/util/vm.RHINO`: Mozilla Rhino. - * + `module:jsdoc/util/vm.NODEJS`: Node.js (not currently supported). - */ -var vm = exports.vm = (function() { - if (Packages && typeof Packages === 'object' && - Object.prototype.toString.call(Packages) === '[object JavaPackage]') { - return RHINO; - } else if ( require && require.main && module && (require.main === module) ) { - return NODEJS; - } else { - // unknown VM - throw new Error('Unable to identify the current JavaScript VM.'); - } -})(); - -/** - * Load the VM-specific implementation of a module. - * - * @param {string} modulePath - The relative path to the module. Use the same format as when calling - * `require()`. - * @return {object} An object containing VM-specific functions for the requested module. - */ -exports.getModule = function(modulePath) { - modulePath = [__dirname, vm, modulePath].join('/').replace(/ /g, '%20'); - if (os.platform() === 'win32') { - modulePath = pathToUri(modulePath); - } - - return require(modulePath); -}; - -/** - * Check whether Mozilla Rhino is running JSDoc. - * @return {boolean} Set to `true` if the current VM is Mozilla Rhino. - */ -exports.isRhino = function() { - return vm === RHINO; -}; - -/** - * Check whether Node.js is running JSDoc. (Node.js is not currently supported.) - * @return {boolean} Set to `true` if the current VM is Node.js. - */ -exports.isNodejs = function() { - return vm === NODEJS; -}; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node/fs.js b/node_modules/jsdoc/node/fs.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node/fs.js rename to node_modules/jsdoc/node/fs.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/esparse b/node_modules/jsdoc/node_modules/.bin/esparse similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/esparse rename to node_modules/jsdoc/node_modules/.bin/esparse diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/esvalidate b/node_modules/jsdoc/node_modules/.bin/esvalidate similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/esvalidate rename to node_modules/jsdoc/node_modules/.bin/esvalidate diff --git a/node_modules/jsdoc/node_modules/.bin/jshint b/node_modules/jsdoc/node_modules/.bin/jshint deleted file mode 120000 index fca005f..0000000 --- a/node_modules/jsdoc/node_modules/.bin/jshint +++ /dev/null @@ -1 +0,0 @@ -../jshint/bin/hint \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/strip-json-comments b/node_modules/jsdoc/node_modules/.bin/strip-json-comments similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/.bin/strip-json-comments rename to node_modules/jsdoc/node_modules/.bin/strip-json-comments diff --git a/node_modules/jsdoc/node_modules/async/package.json b/node_modules/jsdoc/node_modules/async/package.json index 5c6bf41..66cbf73 100644 --- a/node_modules/jsdoc/node_modules/async/package.json +++ b/node_modules/jsdoc/node_modules/async/package.json @@ -28,5 +28,6 @@ "readmeFilename": "README.md", "homepage": "https://github.com/caolan/async", "_id": "async@0.1.22", - "_from": "async@0.1.22" + "_from": "async@0.1.22", + "scripts": {} } diff --git a/node_modules/jsdoc/node_modules/catharsis/LICENSE b/node_modules/jsdoc/node_modules/catharsis/LICENSE index 9a454a2..6fdbb08 100644 --- a/node_modules/jsdoc/node_modules/catharsis/LICENSE +++ b/node_modules/jsdoc/node_modules/catharsis/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2012-2013 Jeff Williams +Copyright (c) 2014 Google Inc. +Copyright (c) 2012-2014 Jeff Williams Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/node_modules/jsdoc/node_modules/catharsis/README.md b/node_modules/jsdoc/node_modules/catharsis/README.md index a09fef3..ecd4945 100644 --- a/node_modules/jsdoc/node_modules/catharsis/README.md +++ b/node_modules/jsdoc/node_modules/catharsis/README.md @@ -10,51 +10,51 @@ Catharsis is designed to be: handle any valid type expression. It uses a [Mocha](http://visionmedia.github.com/mocha/) test suite to verify the parser's accuracy. + **Fast**. Parse results are cached, so the parser is invoked only when necessary. -+ **Flexible**. Catharsis can convert parse results back into type expressions. In addition, it can -parse [JSDoc](https://github.com/jsdoc3/jsdoc)-style type expressions. ++ **Flexible**. Catharsis can convert a parse result back into a type expression, or into a +description of the type expression. In addition, Catharsis can parse +[JSDoc](https://github.com/jsdoc3/jsdoc)-style type expressions. ## Example ## - var catharsis = require('catharsis'); +```js +var catharsis = require('catharsis'); - var type; - var jsdocType; - var parsedType; - var parsedJsdocType; +// Google Closure Compiler parsing +var type = '!Object'; +var parsedType; +try { + parsedType = catharsis.parse(type); // {"type":"NameExpression,"name":"Object","nullable":false} +} catch(e) { + console.error('unable to parse %s: %s', type, e); +} - // Google Closure Compiler parsing - try { - type = '!Object'; - parsedType = catharsis.parse(type); - console.log('%j', parsedType); // {"type":"NameExpression,"name":"Object","nullable":false} - } - catch(e) { - console.error('unable to parse %s: %s', type, e); - } +// JSDoc-style type expressions enabled +var jsdocType = 'string[]'; // Closure Compiler expects Array. +var parsedJsdocType; +try { + parsedJsdocType = catharsis.parse(jsdocType, {jsdoc: true}); +} catch (e) { + console.error('unable to parse %s: %s', jsdocType, e); +} - // JSDoc-style type expressions enabled - try { - jsdocType = 'string[]'; // Closure Compiler expects Array. - parsedJsdocType = catharsis.parse(jsdocType, {jsdoc: true}); - } - catch (e) { - console.error('unable to parse %s: %s', jsdocType, e); - } +// Converting parse results back to type expressions +catharsis.stringify(parsedType); // !Object +catharsis.stringify(parsedJsdocType); // string[] +catharsis.stringify(parsedJsdocType, {restringify: true}); // Array. - console.log(catharsis.stringify(parsedType)); // !Object - console.log(catharsis.stringify(parsedJsdocType)); // string[] - console.log(catharsis.stringify(parsedJsdocType, // Array. - {restringify: true})); +// Converting parse results to descriptions of the type expression +catharsis.describe(parsedType).simple; // non-null Object +catharsis.describe(parsedJsdocType).simple; // Array of string +``` - -See the `test/specs/` directory for more examples of Catharsis' parse results. +See the [test/specs directory](test/specs) for more examples of Catharsis' parse results. ## Methods ## ### parse(typeExpression, options) ### -Parse `typeExpression`, and return the parse results. Throws an error if the type expression cannot +Parse a type expression, and return the parse results. Throws an error if the type expression cannot be parsed. When called without options, Catharsis attempts to parse type expressions in the same way as @@ -82,8 +82,8 @@ application with the expression `Array` (for example, `Array.`). + `options.useCache`: Specifies whether to use the cache of parsed types. Defaults to `true`. #### Returns #### -An object containing the parse results. See the `test/specs/` directory for examples of the parse -results for different type expressions. +An object containing the parse results. See the [test/specs directory](test/specs) for examples of +the parse results for different type expressions. The object also includes two non-enumerable properties: @@ -97,21 +97,23 @@ the stringified type expression cannot be parsed. #### Parameters #### + `parsedType`: An object containing a parsed Closure Compiler type expression. + `options`: Options for stringifying the parse results. - + `options.cssClass`: A CSS class to add to HTML links. Used only if `options.links` is - provided. By default, no CSS class is added. + + `options.cssClass`: Synonym for `options.linkClass`. Deprecated in version 0.8.0; will be + removed in a future version. + `options.htmlSafe`: Specifies whether to return an HTML-safe string that replaces left angle brackets (`<`) with the corresponding entity (`<`). **Note**: Characters in name expressions are not escaped. + + `options.linkClass`: A CSS class to add to HTML links. Used only if `options.links` is + provided. By default, no CSS class is added. + `options.links`: An object whose keys are name expressions and whose values are URIs. If a name expression matches a key in `options.links`, the name expression will be wrapped in an - HTML `` tag that links to the URI. If `options.cssClass` is specified, the `` tag will + HTML `` tag that links to the URI. If `options.linkClass` is specified, the `` tag will include a `class` attribute. **Note**: When using this option, parsed types are always restringified, and the resulting string is not cached. + `options.restringify`: Forces Catharsis to restringify the parsed type. If this option is not specified, and the parsed type object includes a `typeExpression` property, Catharsis will return the `typeExpression` property without modification when possible. Defaults to `false`. - + `options.useCache`: Specifies whether to use the cache of stringified parse results. Defaults - to `true`. + + `options.useCache`: Specifies whether to use the cache of stringified type expressions. + Defaults to `true`. + `options.validate`: Specifies whether to validate the stringified parse results by attempting to parse them as a type expression. If the stringified results are not parsable by default, you must also provide the appropriate options to pass to the `parse()` method. Defaults to `false`. @@ -119,6 +121,83 @@ the stringified type expression cannot be parsed. #### Returns #### A string containing the type expression. +### describe(parsedType, options) ### +Convert a parsed type to a description of the type expression. This method is especially useful if +your users are not familiar with the syntax for type expressions. + +The `describe()` method returns the description in two formats: + ++ **Simple format**. A string that provides a complete description of the type expression. ++ **Extended format**. An object that separates out some of the details about the outermost type +expression, such as whether the type is optional, nullable, or repeatable. + +For example, if you call `describe('?function(new:MyObject, string)=')`, it returns the following +object: + +```js +{ + simple: 'optional nullable function(constructs MyObject, string)', + extended: { + description: 'function(string)', + modifiers: { + functionNew: 'Returns MyObject when called with new.', + functionThis: '', + optional: 'Optional.', + nullable: 'May be null.', + repeatable: '' + }, + returns: '' + } +} +``` + +#### Parameters #### ++ `parsedType`: An object containing a parsed Closure Compiler type expression. ++ `options`: Options for creating the description. + + `options.codeClass`: A CSS class to add to the tag that is wrapped around type names. Used + only if `options.codeTag` is provided. By default, no CSS class is added. + + `options.codeTag`: The name of an HTML tag (for example, `code`) to wrap around type names. + For example, if this option is set to `code`, the type expression `Array.` would have + the simple description `Array of string`. + + `options.language`: A string identifying the language in which to generate the description. + The identifier should be an + [ISO 639-1 language code](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (for example, + `en`). It can optionally be followed by a hyphen and an + [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) (for example, + `en-US`). If you use values other than `en`, you must provide translation resources in + `options.resources`. Defaults to `en`. + + `options.linkClass`: A CSS class to add to HTML links. Used only if `options.links` is + provided. By default, no CSS class is added. + + `options.links`: An object whose keys are name expressions and whose values are URIs. If a + name expression matches a key in `options.links`, the name expression will be wrapped in an + HTML `` tag that links to the URI. If `options.linkClass` is specified, the `` tag will + include a `class` attribute. **Note**: When using this option, the description is not cached. + + `options.resources`: An object that specifies how to describe type expressions for a given + language. The object's property names should use the same format as `options.language`. Each + property should contain an object in the same format as the translation resources in + [res/en.json](res/en.json). If you specify a value for `options.resources.en`, it will override + the defaults in [res/en.json](res/en.json). + + `options.useCache`: Specifies whether to use the cache of descriptions. Defaults to `true`. + +### Returns ### +An object with the following properties: + ++ `simple`: A string that provides a complete description of the type expression. ++ `extended`: An object containing details about the outermost type expression. + + `extended.description`: A string that provides a basic description of the type expression, + excluding the information contained in other properties. + + `extended.modifiers`: Information about modifiers that apply to the type expression. + + `extended.modifiers.functionNew`: A string describing what a function returns when called + with `new`. Used only for function types. + + `extended.modifiers.functionThis`: A string describing what the keyword `this` refers to + within a function. Used only for function types. + + `extended.modifiers.nullable`: A string indicating whether the type is nullable or + non-nullable. + + `extended.modifiers.optional`: A string indicating whether the type is optional. + + `extended.modifiers.repeatable`: A string indicating whether the type can be provided + + `extended.returns`: A string describing the function's return value. Used only for function + types. + ## Installation ## @@ -129,6 +208,8 @@ With [npm](http://npmjs.org): Or without: git clone git://github.com/hegemonic/catharsis.git + cd catharsis + npm install ## Roadmap and known issues ## @@ -145,6 +226,23 @@ pull request, please contact me in advance so I can help things go smoothly. ## Changelog ## ++ 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. + + Type unions that are not enclosed in parentheses can now include the repeatable (`...`) + modifier when JSDoc-style type expressions are enabled. + + Name expressions may now be enclosed in single or double quotation marks when JSDoc-style + type expressions are enabled. ++ 0.8.2 (June 2014): Fixed a compatibility issue with the JSDoc fork of Mozilla Rhino. ++ 0.8.1 (June 2014): Added support for type unions that are not enclosed in parentheses, and that +contain nullable or non-nullable modifiers (for example, `!string|!number`). ++ 0.8.0 (May 2014): + + Added a `describe()` method, which converts a parsed type to a description of the type. + + Added a `linkClass` option to the `stringify()` method, and deprecated the existing `cssClass` + option. The `cssClass` option will be removed in a future release. + + Clarified and corrected several sections in the `README`. ++ 0.7.1 (April 2014): In record types, property names that begin with a keyword (for example, +`undefinedHTML`) are now parsed correctly when JSDoc-style type expressions are enabled. + 0.7.0 (October 2013): + Repeatable type expressions other than name expressions (for example, `...function()`) are now parsed and stringified correctly. diff --git a/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js b/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js index 39435d6..0f00579 100755 --- a/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js +++ b/node_modules/jsdoc/node_modules/catharsis/bin/parseType.js @@ -9,29 +9,47 @@ var util = require('util'); var command = path.basename(process.argv[1]); var typeExpression = process.argv[2]; -var jsdoc = process.argv[3] === '--jsdoc' ? true : false; +var opts = { + describe: false, + jsdoc: false +}; var parsedType; -var opts = { - jsdoc: jsdoc -}; - function usage() { - console.log(util.format('Usage:\n %s typeExpression [--jsdoc]', command)); + console.log(util.format('Usage:\n %s typeExpression [--jsdoc] [--describe]', command)); } +function done(err) { + /*eslint no-process-exit: 0 */ + process.exit(err === undefined ? 0 : err); +} + +process.argv.slice(3).forEach(function(arg) { + var parsedArg = arg.replace(/^\-{2}/, ''); + if (opts[parsedArg] !== undefined) { + opts[parsedArg] = true; + } else { + console.error('Unknown option "%s"', arg); + usage(); + done(1); + } +}); + if (!typeExpression) { usage(); - process.exit(1); + done(1); } else { try { parsedType = catharsis.parse(typeExpression, opts); + if (opts.describe) { + parsedType = catharsis.describe(parsedType); + } } catch (e) { console.error(util.format('Unable to parse "%s" (exception follows):', typeExpression)); console.error(e.stack || e.message); - process.exit(1); + done(1); } console.log(JSON.stringify(parsedType, null, 2)); - process.exit(0); + done(); } diff --git a/node_modules/jsdoc/node_modules/catharsis/catharsis.js b/node_modules/jsdoc/node_modules/catharsis/catharsis.js index bb28e1d..7899f3c 100644 --- a/node_modules/jsdoc/node_modules/catharsis/catharsis.js +++ b/node_modules/jsdoc/node_modules/catharsis/catharsis.js @@ -8,6 +8,7 @@ 'use strict'; +var describe = require('./lib/describe'); var parse = require('./lib/parser').parse; var stringify = require('./lib/stringify'); @@ -21,6 +22,10 @@ var parsedTypeCache = { htmlSafe: {} }; +var descriptionCache = { + normal: {} +}; + function getTypeExpressionCache(options) { if (options.useCache === false) { return null; @@ -41,6 +46,14 @@ function getParsedTypeCache(options) { } } +function getDescriptionCache(options) { + if (options.useCache === false || options.links !== null || options.links !== undefined) { + return null; + } else { + return descriptionCache.normal; + } +} + // can't return the original if any of the following are true: // 1. restringification was requested // 2. htmlSafe option was requested @@ -52,6 +65,21 @@ function canReturnOriginalExpression(parsedType, options) { Object.prototype.hasOwnProperty.call(parsedType, 'typeExpression'); } +// Add non-enumerable properties to a result object, then freeze it. +function prepareFrozenObject(obj, expr, options) { + Object.defineProperty(obj, 'jsdoc', { + value: options.jsdoc === true ? true : false + }); + + if (expr) { + Object.defineProperty(obj, 'typeExpression', { + value: expr + }); + } + + return Object.freeze(obj); +} + function cachedParse(expr, options) { var cache = getTypeExpressionCache(options); var parsedType; @@ -60,16 +88,7 @@ function cachedParse(expr, options) { return cache[expr]; } else { parsedType = parse(expr, options); - - Object.defineProperties(parsedType, { - typeExpression: { - value: expr - }, - jsdoc: { - value: options.jsdoc === true ? true : false - } - }); - parsedType = Object.freeze(parsedType); + parsedType = prepareFrozenObject(parsedType, expr, options); if (cache) { cache[expr] = parsedType; @@ -94,6 +113,23 @@ function cachedStringify(parsedType, options) { } } +function cachedDescribe(parsedType, options) { + var cache = getDescriptionCache(options); + var json; + var result; + + if (cache) { + json = JSON.stringify(parsedType); + cache[json] = cache[json] || describe(parsedType, options); + return cache[json]; + } else { + result = describe(parsedType, options); + result = prepareFrozenObject(result, null, options); + + return result; + } +} + function Catharsis() { this.Types = require('./lib/types'); } @@ -109,9 +145,10 @@ Catharsis.prototype.parse = function(typeExpr, options) { }; Catharsis.prototype.stringify = function(parsedType, options) { - options = options || {}; var result; + options = options || {}; + result = cachedStringify(parsedType, options); if (options.validate) { this.parse(result, options); @@ -120,4 +157,10 @@ Catharsis.prototype.stringify = function(parsedType, options) { return result; }; +Catharsis.prototype.describe = function(parsedType, options) { + options = options || {}; + + return cachedDescribe(parsedType, options); +}; + module.exports = new Catharsis(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/describe.js b/node_modules/jsdoc/node_modules/catharsis/lib/describe.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/lib/describe.js rename to node_modules/jsdoc/node_modules/catharsis/lib/describe.js diff --git a/node_modules/jsdoc/node_modules/catharsis/lib/parser.js b/node_modules/jsdoc/node_modules/catharsis/lib/parser.js index 5bdd45e..dab624b 100644 --- a/node_modules/jsdoc/node_modules/catharsis/lib/parser.js +++ b/node_modules/jsdoc/node_modules/catharsis/lib/parser.js @@ -1,3 +1,4 @@ -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(lit,opt){var result=lit;if(opt.optional){result.optional=true}return result},peg$c10=function(lit){return repeatable(lit)},peg$c11="*",peg$c12='"*"',peg$c13=function(){return{type:Types.AllLiteral}},peg$c14=function(){return{type:Types.NullLiteral}},peg$c15=function(){return{type:Types.UndefinedLiteral}},peg$c16="...",peg$c17='"..."',peg$c18=function(){return{repeatable:true}},peg$c19="=",peg$c20='"="',peg$c21=function(){return{optional:true}},peg$c22="[]",peg$c23='"[]"',peg$c24=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$c25=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$c26=function(name){if(!options.jsdoc){return null}return name},peg$c27=function(t){return repeatable(t)},peg$c28=function(exp,opt){var result={type:Types.NameExpression,name:exp.name,reservedWord:true};if(opt.optional){result.optional=true}return result},peg$c29=".",peg$c30='"."',peg$c31="<",peg$c32='"<"',peg$c33=">",peg$c34='">"',peg$c35=function(sep,l){if(sep===""&&!options.jsdoc){return null}return l},peg$c36=[],peg$c37=",",peg$c38='","',peg$c39=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$c277)}}return s0}function peg$parseHexEscapeSequence(){var s0,s1,s2,s3,s4,s5;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===120){s1=peg$c275;peg$currPos++}else{s1=null;if(peg$silentFails===0){peg$fail(peg$c276)}}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$c223(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$c219;peg$currPos++}else{s1=null;if(peg$silentFails===0){peg$fail(peg$c220)}}if(s1!==null){s2=peg$parseLineTerminatorSequence();if(s2!==null){peg$reportedPos=s0;s1=peg$c261(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$c278)}}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$c279)}}return s0}function peg$parseWhitespace(){var s0;if(peg$c280.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++}else{s0=null;if(peg$silentFails===0){peg$fail(peg$c281)}}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$reportedPos1?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'; + result += strings.join(', ') + '>'; return result; }; Stringifier.prototype.elements = function(elements) { - if (!elements) { - return ''; - } + var result = ''; + var strings = []; - var result = []; + if (!elements) { + return result; + } for (var i = 0, l = elements.length; i < l; i++) { - result.push(this.type(elements[i])); + strings.push(this.type(elements[i])); } - return '(' + result.join('|') + ')'; + result = '(' + strings.join('|') + ')'; + + return result; }; Stringifier.prototype.name = function(name) { @@ -74,30 +78,18 @@ Stringifier.prototype.optional = function(optional) { }; Stringifier.prototype.params = function(params) { + var result = ''; + var strings = []; + if (!params || params.length === 0) { - return ''; + return result; } - var result = []; - - var param; for (var i = 0, l = params.length; i < l; i++) { - result.push(this.type(params[i])); + strings.push(this.type(params[i])); } - return result.join(', '); -}; - -Stringifier.prototype.properties = function(props) { - if (!props) { - return ''; - } - - var result = []; - - for (var i = 0, l = props.length; i < l; i++) { - result.push(this._formatNameAndType(props[i].name, props[i].type)); - } + result = strings.join(', '); return result; }; @@ -110,52 +102,48 @@ Stringifier.prototype['this'] = function(funcThis) { return funcThis ? 'this:' + this.type(funcThis) : ''; }; -// TODO: refactor for clarity Stringifier.prototype.type = function(type) { - var result = ''; + var typeString = ''; if (!type) { - return result; + return typeString; } switch(type.type) { case Types.AllLiteral: - result += this._formatRepeatableAndNullable(type, '', - this._formatNameAndType(type, '*')); + typeString = this._formatNameAndType(type, '*'); break; case Types.FunctionType: - result += this._signature(type); + typeString = this._signature(type); break; case Types.NullLiteral: - result += this._formatRepeatableAndNullable(type, '', - this._formatNameAndType(type, 'null')); + typeString = this._formatNameAndType(type, 'null'); break; case Types.RecordType: - result += this._formatRepeatableAndNullable(type, '', this._record(type)); + typeString = this._record(type); break; case Types.TypeApplication: - result += this._formatRepeatableAndNullable(type, '', this.type(type.expression)); - result += this.applications(type.applications); + typeString = this.type(type.expression) + this.applications(type.applications); break; case Types.UndefinedLiteral: - result += this._formatRepeatableAndNullable(type, '', - this._formatNameAndType(type, 'undefined')); + typeString = this._formatNameAndType(type, 'undefined'); break; case Types.TypeUnion: - result += this._formatRepeatableAndNullable(type, '', this.elements(type.elements)); + typeString = this.elements(type.elements); break; case Types.UnknownLiteral: - result += this._formatRepeatableAndNullable(type, '', - this._formatNameAndType(type, '?')); + typeString = this._formatNameAndType(type, '?'); break; default: - result += this._formatRepeatableAndNullable(type, '', this._formatNameAndType(type)); + typeString = this._formatNameAndType(type); } - // finally, optionality - result += this.optional(type.optional); + // add optional/nullable/repeatable modifiers + if (!this._options._ignoreModifiers) { + typeString = this._addModifiers(type, typeString); + } - return result; + return typeString; }; Stringifier.prototype.stringify = Stringifier.prototype.type; @@ -169,14 +157,14 @@ Stringifier.prototype._record = function(type) { }; Stringifier.prototype._recordFields = function(fields) { - if (!fields) { - return ''; - } + var field; + var keyAndValue; var result = []; - var field; - var keyAndValue; + if (!fields) { + return result; + } for (var i = 0, l = fields.length; i < l; i++) { field = fields[i]; @@ -196,52 +184,64 @@ function combineNameAndType(nameString, typeString) { return nameString + separator + typeString; } -Stringifier.prototype._formatRepeatableAndNullable = function(type, nameString, typeString) { +// Adds optional, nullable, and repeatable modifiers if necessary. +Stringifier.prototype._addModifiers = function(type, typeString) { + var combined; + var open = ''; var close = ''; - var combined; + var optional = ''; if (type.repeatable) { open = this._inFunctionSignatureParams ? '...[' : '...'; close = this._inFunctionSignatureParams ? ']' : ''; } - combined = this.nullable(type.nullable) + combineNameAndType(nameString, typeString); + combined = this.nullable(type.nullable) + combineNameAndType('', typeString); + optional = this.optional(type.optional); - return open + combined + close; + return open + combined + close + optional; +}; + +Stringifier.prototype._addLinks = function(nameString) { + var openTag; + + var linkClass = ''; + var options = this._options; + + if (options.links && Object.prototype.hasOwnProperty.call(options.links, nameString)) { + if (options.linkClass) { + linkClass = ' class="' + options.linkClass + '"'; + } + + openTag = ''; + nameString = openTag + nameString + ''; + } + + return nameString; }; Stringifier.prototype._formatNameAndType = function(type, literal) { var nameString = type.name || literal || ''; var typeString = type.type ? this.type(type.type) : ''; - var cssClass; - var openTag; - // replace the type with an HTML link if necessary - if (this._options.links && Object.prototype.hasOwnProperty.call(this._options.links, - nameString)) { - cssClass = this._options.cssClass ? ' class="' + this._options.cssClass + '"' : ''; - - openTag = ''; - nameString = openTag + nameString + ''; - } + nameString = this._addLinks(nameString); return combineNameAndType(nameString, typeString); }; Stringifier.prototype._signature = function(type) { - var params = []; var param; - var result; - var signatureBase; + var prop; + var signature; + var params = []; // these go within the signature's parens, in this order var props = [ 'new', 'this', 'params' ]; - var prop; this._inFunctionSignatureParams = true; for (var i = 0, l = props.length; i < l; i++) { @@ -253,11 +253,10 @@ Stringifier.prototype._signature = function(type) { } this._inFunctionSignatureParams = false; - signatureBase = 'function(' + params.join(', ') + ')'; - result = this._formatRepeatableAndNullable(type, '', signatureBase); - result += this.result(type.result); + signature = 'function(' + params.join(', ') + ')'; + signature += this.result(type.result); - return result; + return signature; }; diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.npmignore b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.npmignore similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.npmignore rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.npmignore diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.travis.yml b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.travis.yml similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.travis.yml rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/.travis.yml diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CHANGELOG.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CHANGELOG.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CHANGELOG.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CHANGELOG.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CONTRIBUTING.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CONTRIBUTING.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CONTRIBUTING.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/CONTRIBUTING.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/Gruntfile.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/Gruntfile.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/Gruntfile.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/Gruntfile.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/LICENSE b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/LICENSE similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/LICENSE rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/LICENSE diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/README.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/README.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/README.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/README.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/bower.json b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/bower.json similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/bower.json rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/bower.json diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.min.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.min.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.min.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/dist/underscore-contrib.min.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/index.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/index.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/index.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/index.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.builders.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.builders.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.builders.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.builders.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.selectors.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.selectors.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.selectors.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.array.selectors.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.collections.walk.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.collections.walk.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.collections.walk.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.collections.walk.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.arity.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.arity.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.arity.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.arity.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.combinators.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.combinators.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.combinators.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.combinators.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.iterators.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.iterators.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.iterators.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.iterators.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.predicates.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.predicates.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.predicates.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.function.predicates.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.builders.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.builders.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.builders.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.builders.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.selectors.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.selectors.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.selectors.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.object.selectors.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.existential.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.existential.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.existential.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.existential.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.operators.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.operators.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.operators.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.operators.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.strings.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.strings.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.strings.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.strings.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.trampolines.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.trampolines.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.trampolines.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/docs/underscore.util.trampolines.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/examples/walk-examples.js.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/examples/walk-examples.js.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/examples/walk-examples.js.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/examples/walk-examples.js.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.html b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.html rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/index.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/LICENSE b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/LICENSE rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/README.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/README.md rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json similarity index 98% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/package.json rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json index 70d4f93..7b38533 100644 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/package.json +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json @@ -46,5 +46,5 @@ "url": "https://github.com/jashkenas/underscore/issues" }, "_id": "underscore@1.6.0", - "_from": "underscore@>=1.6.0 <1.7.0" + "_from": "underscore@1.6.0" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/underscore-min.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/underscore.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/underscore/underscore.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js diff --git a/node_modules/grunt-jsdoc/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 similarity index 95% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json index 55168b0..bcb3485 100644 --- a/node_modules/grunt-jsdoc/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 @@ -57,5 +57,6 @@ ], "directories": {}, "_shasum": "665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7", - "_resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz" + "_resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.builders.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.builders.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.builders.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.builders.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.selectors.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.selectors.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.selectors.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/array.selectors.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/collections.walk.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/collections.walk.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/collections.walk.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/collections.walk.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-concat.html b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-concat.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-concat.html rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-concat.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-min.html b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-min.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-min.html rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/dist-min.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.arity.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.arity.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.arity.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.arity.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.combinators.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.combinators.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.combinators.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.combinators.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.dispatch.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.dispatch.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.dispatch.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.dispatch.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.iterators.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.iterators.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.iterators.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.iterators.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.predicates.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.predicates.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.predicates.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/function.predicates.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/index.html b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/index.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/index.html rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/index.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.builders.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.builders.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.builders.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.builders.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.selectors.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.selectors.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.selectors.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/object.selectors.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.existential.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.existential.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.existential.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.existential.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.operators.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.operators.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.operators.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.operators.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.strings.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.strings.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.strings.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.strings.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.trampolines.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.trampolines.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.trampolines.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/util.trampolines.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jquery.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jquery.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jquery.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jquery.js diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jslitmus.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jslitmus.js new file mode 100644 index 0000000..a0e9f80 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/jslitmus.js @@ -0,0 +1,670 @@ +// JSLitmus.js +// +// History: +// 2008-10-27: Initial release +// 2008-11-09: Account for iteration loop overhead +// 2008-11-13: Added OS detection +// 2009-02-25: Create tinyURL automatically, shift-click runs tests in reverse +// +// Copyright (c) 2008-2009, Robert Kieffer +// All Rights Reserved +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the +// Software), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 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() { + // Private methods and state + + // Get platform info but don't go crazy trying to recognize everything + // that's out there. This is just for the major platforms and OSes. + var platform = 'unknown platform', ua = navigator.userAgent; + + // Detect OS + var oses = ['Windows','iPhone OS','(Intel |PPC )?Mac OS X','Linux'].join('|'); + var pOS = new RegExp('((' + oses + ') [^ \);]*)').test(ua) ? RegExp.$1 : null; + if (!pOS) pOS = new RegExp('((' + oses + ')[^ \);]*)').test(ua) ? RegExp.$1 : null; + + // Detect browser + var pName = /(Chrome|MSIE|Safari|Opera|Firefox)/.test(ua) ? RegExp.$1 : null; + + // Detect version + var vre = new RegExp('(Version|' + pName + ')[ \/]([^ ;]*)'); + var pVersion = (pName && vre.test(ua)) ? RegExp.$2 : null; + var platform = (pOS && pName && pVersion) ? pName + ' ' + pVersion + ' on ' + pOS : 'unknown platform'; + + /** + * A smattering of methods that are needed to implement the JSLitmus testbed. + */ + var jsl = { + /** + * Enhanced version of escape() + */ + escape: function(s) { + s = s.replace(/,/g, '\\,'); + s = escape(s); + s = s.replace(/\+/g, '%2b'); + s = s.replace(/ /g, '+'); + return s; + }, + + /** + * Get an element by ID. + */ + $: function(id) { + return document.getElementById(id); + }, + + /** + * Null function + */ + F: function() {}, + + /** + * Set the status shown in the UI + */ + status: function(msg) { + var el = jsl.$('jsl_status'); + if (el) el.innerHTML = msg || ''; + }, + + /** + * Convert a number to an abbreviated string like, "15K" or "10M" + */ + toLabel: function(n) { + if (n == Infinity) { + return 'Infinity'; + } else if (n > 1e9) { + n = Math.round(n/1e8); + return n/10 + 'B'; + } else if (n > 1e6) { + n = Math.round(n/1e5); + return n/10 + 'M'; + } else if (n > 1e3) { + n = Math.round(n/1e2); + return n/10 + 'K'; + } + return n; + }, + + /** + * Copy properties from src to dst + */ + extend: function(dst, src) { + for (var k in src) dst[k] = src[k]; return dst; + }, + + /** + * Like Array.join(), but for the key-value pairs in an object + */ + join: function(o, delimit1, delimit2) { + if (o.join) return o.join(delimit1); // If it's an array + var pairs = []; + for (var k in o) pairs.push(k + delimit1 + o[k]); + return pairs.join(delimit2); + }, + + /** + * Array#indexOf isn't supported in IE, so we use this as a cross-browser solution + */ + indexOf: function(arr, o) { + if (arr.indexOf) return arr.indexOf(o); + for (var i = 0; i < this.length; i++) if (arr[i] === o) return i; + return -1; + } + }; + + /** + * Test manages a single test (created with + * JSLitmus.test()) + * + * @private + */ + var Test = function (name, f) { + if (!f) throw new Error('Undefined test function'); + if (!(/function[^\(]*\(([^,\)]*)/).test(f.toString())) { + throw new Error('"' + name + '" test: Test is not a valid Function object'); + } + this.loopArg = RegExp.$1; + this.name = name; + this.f = f; + }; + + jsl.extend(Test, /** @lends Test */ { + /** Calibration tests for establishing iteration loop overhead */ + CALIBRATIONS: [ + new Test('calibrating loop', function(count) {while (count--);}), + new Test('calibrating function', jsl.F) + ], + + /** + * Run calibration tests. Returns true if calibrations are not yet + * complete (in which case calling code should run the tests yet again). + * onCalibrated - Callback to invoke when calibrations have finished + */ + calibrate: function(onCalibrated) { + for (var i = 0; i < Test.CALIBRATIONS.length; i++) { + var cal = Test.CALIBRATIONS[i]; + if (cal.running) return true; + if (!cal.count) { + cal.isCalibration = true; + cal.onStop = onCalibrated; + //cal.MIN_TIME = .1; // Do calibrations quickly + cal.run(2e4); + return true; + } + } + return false; + } + }); + + jsl.extend(Test.prototype, {/** @lends Test.prototype */ + /** Initial number of iterations */ + INIT_COUNT: 10, + /** Max iterations allowed (i.e. used to detect bad looping functions) */ + MAX_COUNT: 1e9, + /** Minimum time a test should take to get valid results (secs) */ + MIN_TIME: .5, + + /** Callback invoked when test state changes */ + onChange: jsl.F, + + /** Callback invoked when test is finished */ + onStop: jsl.F, + + /** + * Reset test state + */ + reset: function() { + delete this.count; + delete this.time; + delete this.running; + delete this.error; + }, + + /** + * Run the test (in a timeout). We use a timeout to make sure the browser + * has a chance to finish rendering any UI changes we've made, like + * updating the status message. + */ + run: function(count) { + count = count || this.INIT_COUNT; + jsl.status(this.name + ' x ' + count); + this.running = true; + var me = this; + setTimeout(function() {me._run(count);}, 200); + }, + + /** + * The nuts and bolts code that actually runs a test + */ + _run: function(count) { + var me = this; + + // Make sure calibration tests have run + if (!me.isCalibration && Test.calibrate(function() {me.run(count);})) return; + this.error = null; + + try { + var start, f = this.f, now, i = count; + + // Start the timer + start = new Date(); + + // Now for the money shot. If this is a looping function ... + if (this.loopArg) { + // ... let it do the iteration itself + f(count); + } else { + // ... otherwise do the iteration for it + while (i--) f(); + } + + // Get time test took (in secs) + this.time = Math.max(1,new Date() - start)/1000; + + // Store iteration count and per-operation time taken + this.count = count; + this.period = this.time/count; + + // Do we need to do another run? + this.running = this.time <= this.MIN_TIME; + + // ... if so, compute how many times we should iterate + if (this.running) { + // Bump the count to the nearest power of 2 + var x = this.MIN_TIME/this.time; + var pow = Math.pow(2, Math.max(1, Math.ceil(Math.log(x)/Math.log(2)))); + count *= pow; + if (count > this.MAX_COUNT) { + throw new Error('Max count exceeded. If this test uses a looping function, make sure the iteration loop is working properly.'); + } + } + } catch (e) { + // Exceptions are caught and displayed in the test UI + this.reset(); + this.error = e; + } + + // Figure out what to do next + if (this.running) { + me.run(count); + } else { + jsl.status(''); + me.onStop(me); + } + + // Finish up + this.onChange(this); + }, + + /** + * Get the number of operations per second for this test. + * + * @param normalize if true, iteration loop overhead taken into account + */ + getHz: function(/**Boolean*/ normalize) { + var p = this.period; + + // Adjust period based on the calibration test time + if (normalize && !this.isCalibration) { + var cal = Test.CALIBRATIONS[this.loopArg ? 0 : 1]; + + // If the period is within 20% of the calibration time, then zero the + // it out + p = p < cal.period*1.2 ? 0 : p - cal.period; + } + + return Math.round(1/p); + }, + + /** + * Get a friendly string describing the test + */ + toString: function() { + return this.name + ' - ' + this.time/this.count + ' secs'; + } + }); + + // CSS we need for the UI + var STYLESHEET = ''; + + // HTML markup for the UI + var MARKUP = '
            \ + \ + \ +
            \ +
            \ + Normalize results \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
            ' + platform + '
            TestOps/sec
            \ +
            \ + \ + Powered by JSLitmus \ +
            '; + + /** + * The public API for creating and running tests + */ + window.JSLitmus = { + /** The list of all tests that have been registered with JSLitmus.test */ + _tests: [], + /** The queue of tests that need to be run */ + _queue: [], + + /** + * The parsed query parameters the current page URL. This is provided as a + * convenience for test functions - it's not used by JSLitmus proper + */ + params: {}, + + /** + * Initialize + */ + _init: function() { + // Parse query params into JSLitmus.params[] hash + var match = (location + '').match(/([^?#]*)(#.*)?$/); + if (match) { + var pairs = match[1].split('&'); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split('='); + if (pair.length > 1) { + var key = pair.shift(); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + this.params[key] = value; + } + } + } + + // Write out the stylesheet. We have to do this here because IE + // doesn't honor sheets written after the document has loaded. + document.write(STYLESHEET); + + // Setup the rest of the UI once the document is loaded + if (window.addEventListener) { + window.addEventListener('load', this._setup, false); + } else if (document.addEventListener) { + document.addEventListener('load', this._setup, false); + } else if (window.attachEvent) { + window.attachEvent('onload', this._setup); + } + + return this; + }, + + /** + * Set up the UI + */ + _setup: function() { + var el = jsl.$('jslitmus_container'); + if (!el) document.body.appendChild(el = document.createElement('div')); + + el.innerHTML = MARKUP; + + // Render the UI for all our tests + for (var i=0; i < JSLitmus._tests.length; i++) + JSLitmus.renderTest(JSLitmus._tests[i]); + }, + + /** + * (Re)render all the test results + */ + renderAll: function() { + for (var i = 0; i < JSLitmus._tests.length; i++) + JSLitmus.renderTest(JSLitmus._tests[i]); + JSLitmus.renderChart(); + }, + + /** + * (Re)render the chart graphics + */ + renderChart: function() { + var url = JSLitmus.chartUrl(); + jsl.$('chart_link').href = url; + jsl.$('chart_image').src = url; + jsl.$('chart').style.display = ''; + + // Update the tiny URL + jsl.$('tiny_url').src = 'http://tinyurl.com/api-create.php?url='+escape(url); + }, + + /** + * (Re)render the results for a specific test + */ + renderTest: function(test) { + // Make a new row if needed + if (!test._row) { + var trow = jsl.$('test_row_template'); + if (!trow) return; + + test._row = trow.cloneNode(true); + test._row.style.display = ''; + test._row.id = ''; + test._row.onclick = function() {JSLitmus._queueTest(test);}; + test._row.title = 'Run ' + test.name + ' test'; + trow.parentNode.appendChild(test._row); + test._row.cells[0].innerHTML = test.name; + } + + var cell = test._row.cells[1]; + var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping']; + + if (test.error) { + cns.push('test_error'); + cell.innerHTML = + '
            ' + test.error + '
            ' + + '
            • ' + + jsl.join(test.error, ': ', '
            • ') + + '
            '; + } else { + if (test.running) { + cns.push('test_running'); + cell.innerHTML = 'running'; + } else if (jsl.indexOf(JSLitmus._queue, test) >= 0) { + cns.push('test_pending'); + cell.innerHTML = 'pending'; + } else if (test.count) { + cns.push('test_done'); + var hz = test.getHz(jsl.$('test_normalize').checked); + cell.innerHTML = hz != Infinity ? hz : '∞'; + } else { + cell.innerHTML = 'ready'; + } + } + cell.className = cns.join(' '); + }, + + /** + * Create a new test + */ + test: function(name, f) { + // Create the Test object + var test = new Test(name, f); + JSLitmus._tests.push(test); + + // Re-render if the test state changes + test.onChange = JSLitmus.renderTest; + + // Run the next test if this one finished + test.onStop = function(test) { + if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test); + JSLitmus.currentTest = null; + JSLitmus._nextTest(); + }; + + // Render the new test + this.renderTest(test); + }, + + /** + * Add all tests to the run queue + */ + runAll: function(e) { + e = e || window.event; + var reverse = e && e.shiftKey, len = JSLitmus._tests.length; + for (var i = 0; i < len; i++) { + JSLitmus._queueTest(JSLitmus._tests[!reverse ? i : (len - i - 1)]); + } + }, + + /** + * Remove all tests from the run queue. The current test has to finish on + * it's own though + */ + stop: function() { + while (JSLitmus._queue.length) { + var test = JSLitmus._queue.shift(); + JSLitmus.renderTest(test); + } + }, + + /** + * Run the next test in the run queue + */ + _nextTest: function() { + if (!JSLitmus.currentTest) { + var test = JSLitmus._queue.shift(); + if (test) { + jsl.$('stop_button').disabled = false; + JSLitmus.currentTest = test; + test.run(); + JSLitmus.renderTest(test); + if (JSLitmus.onTestStart) JSLitmus.onTestStart(test); + } else { + jsl.$('stop_button').disabled = true; + JSLitmus.renderChart(); + } + } + }, + + /** + * Add a test to the run queue + */ + _queueTest: function(test) { + if (jsl.indexOf(JSLitmus._queue, test) >= 0) return; + JSLitmus._queue.push(test); + JSLitmus.renderTest(test); + JSLitmus._nextTest(); + }, + + /** + * Generate a Google Chart URL that shows the data for all tests + */ + chartUrl: function() { + var n = JSLitmus._tests.length, markers = [], data = []; + var d, min = 0, max = -1e10; + var normalize = jsl.$('test_normalize').checked; + + // Gather test data + for (var i=0; i < JSLitmus._tests.length; i++) { + var test = JSLitmus._tests[i]; + if (test.count) { + var hz = test.getHz(normalize); + var v = hz != Infinity ? hz : 0; + data.push(v); + markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' + + markers.length + ',10'); + max = Math.max(v, max); + } + } + if (markers.length <= 0) return null; + + // Build chart title + var title = document.getElementsByTagName('title'); + title = (title && title.length) ? title[0].innerHTML : null; + var chart_title = []; + if (title) chart_title.push(title); + chart_title.push('Ops/sec (' + platform + ')'); + + // Build labels + var labels = [jsl.toLabel(min), jsl.toLabel(max)]; + + var w = 250, bw = 15; + var bs = 5; + var h = markers.length*(bw + bs) + 30 + chart_title.length*20; + + var params = { + chtt: escape(chart_title.join('|')), + chts: '000000,10', + cht: 'bhg', // chart type + chd: 't:' + data.join(','), // data set + chds: min + ',' + max, // max/min of data + chxt: 'x', // label axes + chxl: '0:|' + labels.join('|'), // labels + chsp: '0,1', + chm: markers.join('|'), // test names + chbh: [bw, 0, bs].join(','), // bar widths + // chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient + chs: w + 'x' + h + }; + return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&'); + } + }; + + JSLitmus._init(); +})(); \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.css b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.css rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/qunit.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/runner.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/runner.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/runner.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/runner.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/underscore.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/underscore.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/underscore.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/test/vendor/underscore.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/tocdoc.css b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/tocdoc.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/tocdoc.css rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/tocdoc.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.builders.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.builders.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.builders.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.builders.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.selectors.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.selectors.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.selectors.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.array.selectors.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.collections.walk.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.collections.walk.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.collections.walk.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.collections.walk.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.arity.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.arity.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.arity.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.arity.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.combinators.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.combinators.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.combinators.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.combinators.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.dispatch.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.dispatch.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.dispatch.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.dispatch.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.iterators.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.iterators.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.iterators.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.iterators.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.predicates.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.predicates.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.predicates.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.function.predicates.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.builders.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.builders.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.builders.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.builders.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.selectors.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.selectors.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.selectors.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.object.selectors.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.existential.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.existential.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.existential.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.existential.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.operators.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.operators.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.operators.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.operators.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.strings.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.strings.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.strings.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.strings.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.trampolines.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.trampolines.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.trampolines.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/underscore.util.trampolines.js diff --git a/node_modules/jsdoc/node_modules/catharsis/package.json b/node_modules/jsdoc/node_modules/catharsis/package.json index 1d3fb6d..7ed1557 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.7.0", + "version": "0.8.3", "name": "catharsis", "description": "A JavaScript parser for Google Closure Compiler and JSDoc type expressions.", "author": { @@ -14,19 +14,22 @@ "url": "https://github.com/hegemonic/catharsis/issues" }, "main": "catharsis.js", + "dependencies": { + "underscore-contrib": "~0.3.0" + }, "devDependencies": { - "mocha": "1.13.0", - "pegjs": "git+ssh://git@github.com:dmajda/pegjs.git#76cc5d55", - "should": "1.3.0", - "uglify-js": "2.4.0", - "underscore": "1.5.2" + "mocha": "~1.21.3", + "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" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.8" }, "scripts": { - "build": "./node_modules/.bin/pegjs ./lib/parser.pegjs", - "prepublish": "./node_modules/.bin/pegjs ./lib/parser.pegjs; ./node_modules/.bin/uglifyjs ./lib/parser.js -o ./lib/parser.js", + "build": "pegjs ./lib/parser.pegjs", + "prepublish": "pegjs ./lib/parser.pegjs; ./node_modules/.bin/uglifyjs ./lib/parser.js -o ./lib/parser.js", "test": "mocha" }, "licenses": [ @@ -35,14 +38,12 @@ "url": "http://github.com/hegemonic/catharsis/raw/master/LICENSE" } ], + "gitHead": "8795105b00acf02d0af464ad3432f47b53744934", "homepage": "https://github.com/hegemonic/catharsis", - "_id": "catharsis@0.7.0", - "dist": { - "shasum": "37b3854a9a79b71bd7750279913313b160978c6e", - "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.7.0.tgz" - }, - "_from": "catharsis@0.7.0", - "_npmVersion": "1.3.11", + "_id": "catharsis@0.8.3", + "_shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", + "_from": "catharsis@>=0.8.2 <0.9.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "hegemonic", "email": "jeffrey.l.williams@gmail.com" @@ -53,7 +54,11 @@ "email": "jeffrey.l.williams@gmail.com" } ], + "dist": { + "shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", + "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz" + }, "directories": {}, - "_shasum": "37b3854a9a79b71bd7750279913313b160978c6e", - "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.7.0.tgz" + "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/res/en.json b/node_modules/jsdoc/node_modules/catharsis/res/en.json similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/catharsis/res/en.json rename to node_modules/jsdoc/node_modules/catharsis/res/en.json diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/example/bundle.js b/node_modules/jsdoc/node_modules/crypto-browserify/example/bundle.js deleted file mode 100644 index 02698cc..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/example/bundle.js +++ /dev/null @@ -1,637 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var res = mod._cached ? mod._cached : mod(); - return res; -} - -require.paths = []; -require.modules = {}; -require.extensions = [".js",".coffee"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = x + '/package.json'; - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -require.define = function (filename, fn) { - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - return require(file, dirname) - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - var module_ = { exports : {} }; - - require.modules[filename] = function () { - require.modules[filename]._cached = module_.exports; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename - ); - require.modules[filename]._cached = module_.exports; - return module_.exports; - }; -}; - -if (typeof process === 'undefined') process = {}; - -if (!process.nextTick) process.nextTick = (function () { - var queue = []; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canPost) { - window.addEventListener('message', function (ev) { - if (ev.source === window && ev.data === 'browserify-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - } - - return function (fn) { - if (canPost) { - queue.push(fn); - window.postMessage('browserify-tick', '*'); - } - else setTimeout(fn, 0); - }; -})(); - -if (!process.title) process.title = 'browser'; - -if (!process.binding) process.binding = function (name) { - if (name === 'evals') return require('vm') - else throw new Error('No such module') -}; - -if (!process.cwd) process.cwd = function () { return '.' }; - -if (!process.env) process.env = {}; -if (!process.argv) process.argv = []; - -require.define("path", function (require, module, exports, __dirname, __filename) { -function filter (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - if (fn(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length; i >= 0; i--) { - var last = parts[i]; - if (last == '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Regex to split a filename into [*, dir, basename, ext] -// posix version -var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { -var resolvedPath = '', - resolvedAbsolute = false; - -for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) - ? arguments[i] - : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string' || !path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; -} - -// At this point the path should be resolved to a full absolute path, but -// handle relative paths to be safe (might happen when process.cwd() fails) - -// Normalize the path -resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { -var isAbsolute = path.charAt(0) === '/', - trailingSlash = path.slice(-1) === '/'; - -// Normalize the path -path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - return p && typeof p === 'string'; - }).join('/')); -}; - - -exports.dirname = function(path) { - var dir = splitPathRe.exec(path)[1] || ''; - var isWindows = false; - if (!dir) { - // No dirname - return '.'; - } else if (dir.length === 1 || - (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { - // It is just a slash or a drive letter with a slash - return dir; - } else { - // It is a full dirname, strip trailing slash - return dir.substring(0, dir.length - 1); - } -}; - - -exports.basename = function(path, ext) { - var f = splitPathRe.exec(path)[2] || ''; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPathRe.exec(path)[3] || ''; -}; - -}); - -require.define("crypto", function (require, module, exports, __dirname, __filename) { -module.exports = require("crypto-browserify") -}); - -require.define("/node_modules/crypto-browserify/package.json", function (require, module, exports, __dirname, __filename) { -module.exports = {} -}); - -require.define("/node_modules/crypto-browserify/index.js", function (require, module, exports, __dirname, __filename) { -var sha = require('./sha') - -var algorithms = { - sha1: { - hex: sha.hex_sha1, - binary: sha.b64_sha1, - ascii: sha.str_sha1 - } -} - -function error () { - var m = [].slice.call(arguments).join(' ') - throw new Error([ - m, - 'we accept pull requests', - 'http://github.com/dominictarr/crypto-browserify' - ].join('\n')) -} - -exports.createHash = function (alg) { - alg = alg || 'sha1' - if(!algorithms[alg]) - error('algorithm:', alg, 'is not yet supported') - var s = '' - _alg = algorithms[alg] - return { - update: function (data) { - s += data - return this - }, - digest: function (enc) { - enc = enc || 'binary' - var fn - if(!(fn = _alg[enc])) - error('encoding:', enc , 'is not yet supported for algorithm', alg) - var r = fn(s) - s = null //not meant to use the hash after you've called digest. - return r - } - } -} -// the least I can do is make error messages for the rest of the node.js/crypto api. -;['createCredentials' -, 'createHmac' -, 'createCypher' -, 'createCypheriv' -, 'createDecipher' -, 'createDecipheriv' -, 'createSign' -, 'createVerify' -, 'createDeffieHellman', -, 'pbkdf2', -, 'randomBytes' ].forEach(function (name) { - exports[name] = function () { - error('sorry,', name, 'is not implemented yet') - } -}) - -}); - -require.define("/node_modules/crypto-browserify/sha.js", function (require, module, exports, __dirname, __filename) { -/* - * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined - * in FIPS PUB 180-1 - * Version 2.1a Copyright Paul Johnston 2000 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for details. - */ - -exports.hex_sha1 = hex_sha1; -exports.b64_sha1 = b64_sha1; -exports.str_sha1 = str_sha1; -exports.hex_hmac_sha1 = hex_hmac_sha1; -exports.b64_hmac_sha1 = b64_hmac_sha1; -exports.str_hmac_sha1 = str_hmac_sha1; - -/* - * Configurable variables. You may need to tweak these to be compatible with - * the server-side, but the defaults work in most cases. - */ -var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ -var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ -var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ - -/* - * These are the functions you'll usually want to call - * They take string arguments and return either hex or base-64 encoded strings - */ -function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} -function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} -function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} -function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} -function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} -function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} - -/* - * Perform a simple self-test to see if the VM is working - */ -function sha1_vm_test() -{ - return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; -} - -/* - * Calculate the SHA-1 of an array of big-endian words, and a bit length - */ -function core_sha1(x, len) -{ - /* append padding */ - x[len >> 5] |= 0x80 << (24 - len % 32); - x[((len + 64 >> 9) << 4) + 15] = len; - - var w = Array(80); - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - var e = -1009589776; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - var olde = e; - - for(var j = 0; j < 80; j++) - { - if(j < 16) w[j] = x[i + j]; - else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); - var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), - safe_add(safe_add(e, w[j]), sha1_kt(j))); - e = d; - d = c; - c = rol(b, 30); - b = a; - a = t; - } - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - e = safe_add(e, olde); - } - return Array(a, b, c, d, e); - -} - -/* - * Perform the appropriate triplet combination function for the current - * iteration - */ -function sha1_ft(t, b, c, d) -{ - if(t < 20) return (b & c) | ((~b) & d); - if(t < 40) return b ^ c ^ d; - if(t < 60) return (b & c) | (b & d) | (c & d); - return b ^ c ^ d; -} - -/* - * Determine the appropriate additive constant for the current iteration - */ -function sha1_kt(t) -{ - return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : - (t < 60) ? -1894007588 : -899497514; -} - -/* - * Calculate the HMAC-SHA1 of a key and some data - */ -function core_hmac_sha1(key, data) -{ - var bkey = str2binb(key); - if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); - - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - - var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); - return core_sha1(opad.concat(hash), 512 + 160); -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add(x, y) -{ - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function rol(num, cnt) -{ - return (num << cnt) | (num >>> (32 - cnt)); -} - -/* - * Convert an 8-bit or 16-bit string to an array of big-endian words - * In 8-bit function, characters >255 have their hi-byte silently ignored. - */ -function str2binb(str) -{ - var bin = Array(); - var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); - return bin; -} - -/* - * Convert an array of big-endian words to a string - */ -function binb2str(bin) -{ - var str = ""; - var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); - return str; -} - -/* - * Convert an array of big-endian words to a hex string. - */ -function binb2hex(binarray) -{ - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - { - str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + - hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); - } - return str; -} - -/* - * Convert an array of big-endian words to a base-64 string - */ -function binb2b64(binarray) -{ - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; - else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; -} - - -}); - -require.define("/test.js", function (require, module, exports, __dirname, __filename) { - var crypto = require('crypto') -var abc = crypto.createHash('sha1').update('abc').digest('hex') -console.log(abc) -//require('hello').inlineCall().call2() - -}); -require("/test.js"); diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/example/index.html b/node_modules/jsdoc/node_modules/crypto-browserify/example/index.html deleted file mode 100644 index 9d55c6d..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/example/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -
            -  require('crypto').createHash('sha1').update('abc').digest('hex') == ''
            -  
            - - - diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/example/test.js b/node_modules/jsdoc/node_modules/crypto-browserify/example/test.js deleted file mode 100644 index f1b0e4a..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/example/test.js +++ /dev/null @@ -1,4 +0,0 @@ -var crypto = require('crypto') -var abc = crypto.createHash('sha1').update('abc').digest('hex') -console.log(abc) -//require('hello').inlineCall().call2() diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/index.js b/node_modules/jsdoc/node_modules/crypto-browserify/index.js deleted file mode 100644 index a6762ed..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/index.js +++ /dev/null @@ -1,68 +0,0 @@ -var sha = require('./sha') -var rng = require('./rng') - -var algorithms = { - sha1: { - hex: sha.hex_sha1, - binary: sha.b64_sha1, - ascii: sha.str_sha1 - } -} - -function error () { - var m = [].slice.call(arguments).join(' ') - throw new Error([ - m, - 'we accept pull requests', - 'http://github.com/dominictarr/crypto-browserify' - ].join('\n')) -} - -exports.createHash = function (alg) { - alg = alg || 'sha1' - if(!algorithms[alg]) - error('algorithm:', alg, 'is not yet supported') - var s = '' - var _alg = algorithms[alg] - return { - update: function (data) { - s += data - return this - }, - digest: function (enc) { - enc = enc || 'binary' - var fn - if(!(fn = _alg[enc])) - error('encoding:', enc , 'is not yet supported for algorithm', alg) - var r = fn(s) - s = null //not meant to use the hash after you've called digest. - return r - } - } -} - -exports.randomBytes = function(size, callback) { - if (callback && callback.call) { - try { - callback.call(this, undefined, rng(size)); - } catch (err) { callback(err); } - } else { - return rng(size); - } -} - -// the least I can do is make error messages for the rest of the node.js/crypto api. -;['createCredentials' -, 'createHmac' -, 'createCypher' -, 'createCypheriv' -, 'createDecipher' -, 'createDecipheriv' -, 'createSign' -, 'createVerify' -, 'createDeffieHellman' -, 'pbkdf2'].forEach(function (name) { - exports[name] = function () { - error('sorry,', name, 'is not implemented yet') - } -}) diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/package.json b/node_modules/jsdoc/node_modules/crypto-browserify/package.json deleted file mode 100644 index c2b34ab..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "dominictarr.com" - }, - "name": "crypto-browserify", - "description": "partial implementation of crypto for the browser", - "version": "0.1.1", - "homepage": "https://github.com/dominictarr/crypto-browserify", - "repository": { - "url": "" - }, - "scripts": { - "test": "node test/simple.js" - }, - "engines": { - "node": "*" - }, - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "readme": "# crypto-browserify\n\nA (partial) port of `crypto` to the browser.\n\nBasically, I found some crypto implemented in JS lieing on the internet somewhere\nand wrapped it in the part of the `crypto` api that I am currently using.\n\nIn a way that will be compatible with [browserify](https://github.com/substack/node-browserify/).\n\nI will extend this if I need more features, or if anyone else wants to extend this,\nI will add you as a maintainer.\n\nProvided that you agree that it should replicate the [node.js/crypto](http://nodejs.org/api/crypto.html) api exactly, of course.\n\n", - "readmeFilename": "readme.markdown", - "_id": "crypto-browserify@0.1.1", - "_shasum": "c2d2d33a00851d236862a8b2e79947a918653be2", - "_resolved": "git+https://github.com/dominictarr/crypto-browserify.git#95c5d50581ce0b4fff6e76e45dc0bb3622be4e9a", - "_from": "crypto-browserify@git+https://github.com/dominictarr/crypto-browserify.git#95c5d505" -} diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/readme.markdown b/node_modules/jsdoc/node_modules/crypto-browserify/readme.markdown deleted file mode 100644 index 2234c53..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/readme.markdown +++ /dev/null @@ -1,14 +0,0 @@ -# crypto-browserify - -A (partial) port of `crypto` to the browser. - -Basically, I found some crypto implemented in JS lieing on the internet somewhere -and wrapped it in the part of the `crypto` api that I am currently using. - -In a way that will be compatible with [browserify](https://github.com/substack/node-browserify/). - -I will extend this if I need more features, or if anyone else wants to extend this, -I will add you as a maintainer. - -Provided that you agree that it should replicate the [node.js/crypto](http://nodejs.org/api/crypto.html) api exactly, of course. - diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/rng.js b/node_modules/jsdoc/node_modules/crypto-browserify/rng.js deleted file mode 100644 index 2160788..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/rng.js +++ /dev/null @@ -1,37 +0,0 @@ -// Original code adapted from Robert Kieffer. -// details at https://github.com/broofa/node-uuid -(function() { - var _global = this; - - var mathRNG, whatwgRNG; - - // NOTE: Math.random() does not guarantee "cryptographic quality" - mathRNG = function(size) { - var bytes = new Array(size); - var r; - - for (var i = 0, r; i < size; i++) { - if ((i & 0x03) == 0) r = Math.random() * 0x100000000; - bytes[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return bytes; - } - - // currently only available in webkit-based browsers. - if (_global.crypto && crypto.getRandomValues) { - var _rnds = new Uint32Array(4); - whatwgRNG = function(size) { - var bytes = new Array(size); - crypto.getRandomValues(_rnds); - - for (var c = 0 ; c < size; c++) { - bytes[c] = _rnds[c >> 2] >>> ((c & 0x03) * 8) & 0xff; - } - return bytes; - } - } - - module.exports = whatwgRNG || mathRNG; - -}()) \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/sha.js b/node_modules/jsdoc/node_modules/crypto-browserify/sha.js deleted file mode 100644 index 4f9cc3e..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/sha.js +++ /dev/null @@ -1,210 +0,0 @@ -/* - * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined - * in FIPS PUB 180-1 - * Version 2.1a Copyright Paul Johnston 2000 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for details. - */ - -exports.hex_sha1 = hex_sha1; -exports.b64_sha1 = b64_sha1; -exports.str_sha1 = str_sha1; -exports.hex_hmac_sha1 = hex_hmac_sha1; -exports.b64_hmac_sha1 = b64_hmac_sha1; -exports.str_hmac_sha1 = str_hmac_sha1; - -/* - * Configurable variables. You may need to tweak these to be compatible with - * the server-side, but the defaults work in most cases. - */ -var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ -var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ -var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ - -/* - * These are the functions you'll usually want to call - * They take string arguments and return either hex or base-64 encoded strings - */ -function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} -function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} -function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} -function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} -function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} -function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} - -/* - * Perform a simple self-test to see if the VM is working - */ -function sha1_vm_test() -{ - return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; -} - -/* - * Calculate the SHA-1 of an array of big-endian words, and a bit length - */ -function core_sha1(x, len) -{ - /* append padding */ - x[len >> 5] |= 0x80 << (24 - len % 32); - x[((len + 64 >> 9) << 4) + 15] = len; - - var w = Array(80); - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - var e = -1009589776; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - var olde = e; - - for(var j = 0; j < 80; j++) - { - if(j < 16) w[j] = x[i + j]; - else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); - var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), - safe_add(safe_add(e, w[j]), sha1_kt(j))); - e = d; - d = c; - c = rol(b, 30); - b = a; - a = t; - } - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - e = safe_add(e, olde); - } - return Array(a, b, c, d, e); - -} - -/* - * Perform the appropriate triplet combination function for the current - * iteration - */ -function sha1_ft(t, b, c, d) -{ - if(t < 20) return (b & c) | ((~b) & d); - if(t < 40) return b ^ c ^ d; - if(t < 60) return (b & c) | (b & d) | (c & d); - return b ^ c ^ d; -} - -/* - * Determine the appropriate additive constant for the current iteration - */ -function sha1_kt(t) -{ - return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : - (t < 60) ? -1894007588 : -899497514; -} - -/* - * Calculate the HMAC-SHA1 of a key and some data - */ -function core_hmac_sha1(key, data) -{ - var bkey = str2binb(key); - if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); - - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - - var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); - return core_sha1(opad.concat(hash), 512 + 160); -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add(x, y) -{ - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function rol(num, cnt) -{ - return (num << cnt) | (num >>> (32 - cnt)); -} - -/* - * Convert an 8-bit or 16-bit string to an array of big-endian words - * In 8-bit function, characters >255 have their hi-byte silently ignored. - */ -function str2binb(str) -{ - var bin = Array(); - var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); - return bin; -} - -/* - * Convert an array of big-endian words to a string - */ -function binb2str(bin) -{ - var str = ""; - var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); - return str; -} - -/* - * Convert an array of big-endian words to a hex string. - */ -function binb2hex(binarray) -{ - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - { - str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + - hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); - } - return str; -} - -/* - * Convert an array of big-endian words to a base-64 string - */ -function binb2b64(binarray) -{ - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; - else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; -} - diff --git a/node_modules/jsdoc/node_modules/crypto-browserify/test/simple.js b/node_modules/jsdoc/node_modules/crypto-browserify/test/simple.js deleted file mode 100644 index 2b0b994..0000000 --- a/node_modules/jsdoc/node_modules/crypto-browserify/test/simple.js +++ /dev/null @@ -1,25 +0,0 @@ -var crypto = require('crypto') -var cryptoB = require('../') -var assert = require('assert') - - -function assertSame (fn) { - fn(crypto, function (err, expected) { - fn(cryptoB, function (err, actual) { - assert.equal(actual, expected) - }) - }) -} - -assertSame(function (crypto, cb) { - cb(null, crypto.createHash('sha1').update('hello', 'utf-8').digest('hex')) -}) - -assert.equal(cryptoB.randomBytes(10).length, 10) - -cryptoB.randomBytes(10, function(ex, bytes) { - assert.ifError(ex) - bytes.forEach(function(bite) { - assert.equal(typeof bite, 'number') - }); -}) \ No newline at end of file diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/.eslintrc b/node_modules/jsdoc/node_modules/esprima/.eslintrc similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/.eslintrc rename to node_modules/jsdoc/node_modules/esprima/.eslintrc diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/.npmignore b/node_modules/jsdoc/node_modules/esprima/.npmignore similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/.npmignore rename to node_modules/jsdoc/node_modules/esprima/.npmignore diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/.travis.yml b/node_modules/jsdoc/node_modules/esprima/.travis.yml similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/.travis.yml rename to node_modules/jsdoc/node_modules/esprima/.travis.yml diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/ChangeLog b/node_modules/jsdoc/node_modules/esprima/ChangeLog similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/ChangeLog rename to node_modules/jsdoc/node_modules/esprima/ChangeLog diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/LICENSE.BSD b/node_modules/jsdoc/node_modules/esprima/LICENSE.BSD similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/LICENSE.BSD rename to node_modules/jsdoc/node_modules/esprima/LICENSE.BSD diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/README.md b/node_modules/jsdoc/node_modules/esprima/README.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/README.md rename to node_modules/jsdoc/node_modules/esprima/README.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/foundation/foundation.min.css b/node_modules/jsdoc/node_modules/esprima/assets/foundation/foundation.min.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/foundation/foundation.min.css rename to node_modules/jsdoc/node_modules/esprima/assets/foundation/foundation.min.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/images/autocomplete.png b/node_modules/jsdoc/node_modules/esprima/assets/images/autocomplete.png similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/images/autocomplete.png rename to node_modules/jsdoc/node_modules/esprima/assets/images/autocomplete.png diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/json2.js b/node_modules/jsdoc/node_modules/esprima/assets/json2.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/json2.js rename to node_modules/jsdoc/node_modules/esprima/assets/json2.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.css b/node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.css rename to node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.min.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.min.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.min.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/built-editor.min.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/doctrine.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/doctrine.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/doctrine.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/doctrine.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprima.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprima.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprima.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprima.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaJsContentAssist.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaJsContentAssist.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaJsContentAssist.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaJsContentAssist.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaVisitor.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaVisitor.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaVisitor.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/esprimaVisitor.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/proposalUtils.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/proposalUtils.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/proposalUtils.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/proposalUtils.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/types.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/types.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/types.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/contentassist/types.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/customeditor.js b/node_modules/jsdoc/node_modules/esprima/assets/orion/customeditor.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/orion/customeditor.js rename to node_modules/jsdoc/node_modules/esprima/assets/orion/customeditor.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.css b/node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.css rename to node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.js b/node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.js rename to node_modules/jsdoc/node_modules/esprima/assets/prettify/prettify.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/require.js b/node_modules/jsdoc/node_modules/esprima/assets/require.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/require.js rename to node_modules/jsdoc/node_modules/esprima/assets/require.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/style.css b/node_modules/jsdoc/node_modules/esprima/assets/style.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/assets/style.css rename to node_modules/jsdoc/node_modules/esprima/assets/style.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/bin/esparse.js b/node_modules/jsdoc/node_modules/esprima/bin/esparse.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/bin/esparse.js rename to node_modules/jsdoc/node_modules/esprima/bin/esparse.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/bin/esvalidate.js b/node_modules/jsdoc/node_modules/esprima/bin/esvalidate.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/bin/esvalidate.js rename to node_modules/jsdoc/node_modules/esprima/bin/esvalidate.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/component.json b/node_modules/jsdoc/node_modules/esprima/component.json similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/component.json rename to node_modules/jsdoc/node_modules/esprima/component.json diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/autocomplete.html b/node_modules/jsdoc/node_modules/esprima/demo/autocomplete.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/autocomplete.html rename to node_modules/jsdoc/node_modules/esprima/demo/autocomplete.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/collector.html b/node_modules/jsdoc/node_modules/esprima/demo/collector.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/collector.html rename to node_modules/jsdoc/node_modules/esprima/demo/collector.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/collector.js b/node_modules/jsdoc/node_modules/esprima/demo/collector.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/collector.js rename to node_modules/jsdoc/node_modules/esprima/demo/collector.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/functiontrace.html b/node_modules/jsdoc/node_modules/esprima/demo/functiontrace.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/functiontrace.html rename to node_modules/jsdoc/node_modules/esprima/demo/functiontrace.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/functiontrace.js b/node_modules/jsdoc/node_modules/esprima/demo/functiontrace.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/functiontrace.js rename to node_modules/jsdoc/node_modules/esprima/demo/functiontrace.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/highlight.html b/node_modules/jsdoc/node_modules/esprima/demo/highlight.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/highlight.html rename to node_modules/jsdoc/node_modules/esprima/demo/highlight.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/highlight.js b/node_modules/jsdoc/node_modules/esprima/demo/highlight.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/highlight.js rename to node_modules/jsdoc/node_modules/esprima/demo/highlight.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/index.html b/node_modules/jsdoc/node_modules/esprima/demo/index.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/index.html rename to node_modules/jsdoc/node_modules/esprima/demo/index.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/minify.html b/node_modules/jsdoc/node_modules/esprima/demo/minify.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/minify.html rename to node_modules/jsdoc/node_modules/esprima/demo/minify.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/minify.js b/node_modules/jsdoc/node_modules/esprima/demo/minify.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/minify.js rename to node_modules/jsdoc/node_modules/esprima/demo/minify.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/parse.css b/node_modules/jsdoc/node_modules/esprima/demo/parse.css similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/parse.css rename to node_modules/jsdoc/node_modules/esprima/demo/parse.css diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/parse.html b/node_modules/jsdoc/node_modules/esprima/demo/parse.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/parse.html rename to node_modules/jsdoc/node_modules/esprima/demo/parse.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/parse.js b/node_modules/jsdoc/node_modules/esprima/demo/parse.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/parse.js rename to node_modules/jsdoc/node_modules/esprima/demo/parse.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/precedence.html b/node_modules/jsdoc/node_modules/esprima/demo/precedence.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/precedence.html rename to node_modules/jsdoc/node_modules/esprima/demo/precedence.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/precedence.js b/node_modules/jsdoc/node_modules/esprima/demo/precedence.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/precedence.js rename to node_modules/jsdoc/node_modules/esprima/demo/precedence.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/rewrite.html b/node_modules/jsdoc/node_modules/esprima/demo/rewrite.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/rewrite.html rename to node_modules/jsdoc/node_modules/esprima/demo/rewrite.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/rewrite.js b/node_modules/jsdoc/node_modules/esprima/demo/rewrite.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/rewrite.js rename to node_modules/jsdoc/node_modules/esprima/demo/rewrite.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/transpile.html b/node_modules/jsdoc/node_modules/esprima/demo/transpile.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/transpile.html rename to node_modules/jsdoc/node_modules/esprima/demo/transpile.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/transpile.js b/node_modules/jsdoc/node_modules/esprima/demo/transpile.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/transpile.js rename to node_modules/jsdoc/node_modules/esprima/demo/transpile.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/validate.html b/node_modules/jsdoc/node_modules/esprima/demo/validate.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/validate.html rename to node_modules/jsdoc/node_modules/esprima/demo/validate.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/validate.js b/node_modules/jsdoc/node_modules/esprima/demo/validate.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/demo/validate.js rename to node_modules/jsdoc/node_modules/esprima/demo/validate.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/doc/index.html b/node_modules/jsdoc/node_modules/esprima/doc/index.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/doc/index.html rename to node_modules/jsdoc/node_modules/esprima/doc/index.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/esprima.js b/node_modules/jsdoc/node_modules/esprima/esprima.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/esprima.js rename to node_modules/jsdoc/node_modules/esprima/esprima.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/examples/detectnestedternary.js b/node_modules/jsdoc/node_modules/esprima/examples/detectnestedternary.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/examples/detectnestedternary.js rename to node_modules/jsdoc/node_modules/esprima/examples/detectnestedternary.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/examples/findbooleantrap.js b/node_modules/jsdoc/node_modules/esprima/examples/findbooleantrap.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/examples/findbooleantrap.js rename to node_modules/jsdoc/node_modules/esprima/examples/findbooleantrap.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/examples/tokendist.js b/node_modules/jsdoc/node_modules/esprima/examples/tokendist.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/examples/tokendist.js rename to node_modules/jsdoc/node_modules/esprima/examples/tokendist.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/index.html b/node_modules/jsdoc/node_modules/esprima/index.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/index.html rename to node_modules/jsdoc/node_modules/esprima/index.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/package.json b/node_modules/jsdoc/node_modules/esprima/package.json similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/package.json rename to node_modules/jsdoc/node_modules/esprima/package.json diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/XMLHttpRequest.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/XMLHttpRequest.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/XMLHttpRequest.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/XMLHttpRequest.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/acorn.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/acorn.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/acorn.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/acorn.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/angular-1.0.2.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/angular-1.0.2.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/angular-1.0.2.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/angular-1.0.2.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/backbone-0.9.2.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/backbone-0.9.2.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/backbone-0.9.2.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/backbone-0.9.2.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/benchmark.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/benchmark.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/benchmark.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/benchmark.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/codemirror-2.34.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/codemirror-2.34.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/codemirror-2.34.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/codemirror-2.34.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/escodegen.browser.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/escodegen.browser.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/escodegen.browser.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/escodegen.browser.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmangle.browser.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmangle.browser.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmangle.browser.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmangle.browser.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmorph.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmorph.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmorph.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/esmorph.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/harmonizr.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/harmonizr.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/harmonizr.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/harmonizr.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery-1.8.2.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery-1.8.2.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery-1.8.2.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery-1.8.2.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery.mobile-1.2.0.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery.mobile-1.2.0.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery.mobile-1.2.0.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/jquery.mobile-1.2.0.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/modifier.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/modifier.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/modifier.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/modifier.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/mootools-1.4.1.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/mootools-1.4.1.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/mootools-1.4.1.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/mootools-1.4.1.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/parse-js.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/parse-js.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/parse-js.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/parse-js.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/threejs-r51.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/threejs-r51.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/threejs-r51.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/threejs-r51.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/underscore-1.4.1.js b/node_modules/jsdoc/node_modules/esprima/test/3rdparty/underscore-1.4.1.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/3rdparty/underscore-1.4.1.js rename to node_modules/jsdoc/node_modules/esprima/test/3rdparty/underscore-1.4.1.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/benchmarks.html b/node_modules/jsdoc/node_modules/esprima/test/benchmarks.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/benchmarks.html rename to node_modules/jsdoc/node_modules/esprima/test/benchmarks.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/benchmarks.js b/node_modules/jsdoc/node_modules/esprima/test/benchmarks.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/benchmarks.js rename to node_modules/jsdoc/node_modules/esprima/test/benchmarks.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compare.html b/node_modules/jsdoc/node_modules/esprima/test/compare.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compare.html rename to node_modules/jsdoc/node_modules/esprima/test/compare.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compare.js b/node_modules/jsdoc/node_modules/esprima/test/compare.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compare.js rename to node_modules/jsdoc/node_modules/esprima/test/compare.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compat.html b/node_modules/jsdoc/node_modules/esprima/test/compat.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compat.html rename to node_modules/jsdoc/node_modules/esprima/test/compat.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compat.js b/node_modules/jsdoc/node_modules/esprima/test/compat.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/compat.js rename to node_modules/jsdoc/node_modules/esprima/test/compat.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/coverage.html b/node_modules/jsdoc/node_modules/esprima/test/coverage.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/coverage.html rename to node_modules/jsdoc/node_modules/esprima/test/coverage.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/esprima.js.html b/node_modules/jsdoc/node_modules/esprima/test/esprima.js.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/esprima.js.html rename to node_modules/jsdoc/node_modules/esprima/test/esprima.js.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/harmonytest.js b/node_modules/jsdoc/node_modules/esprima/test/harmonytest.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/harmonytest.js rename to node_modules/jsdoc/node_modules/esprima/test/harmonytest.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/index.html b/node_modules/jsdoc/node_modules/esprima/test/index.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/index.html rename to node_modules/jsdoc/node_modules/esprima/test/index.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/module.html b/node_modules/jsdoc/node_modules/esprima/test/module.html similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/module.html rename to node_modules/jsdoc/node_modules/esprima/test/module.html diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/module.js b/node_modules/jsdoc/node_modules/esprima/test/module.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/module.js rename to node_modules/jsdoc/node_modules/esprima/test/module.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/reflect.js b/node_modules/jsdoc/node_modules/esprima/test/reflect.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/reflect.js rename to node_modules/jsdoc/node_modules/esprima/test/reflect.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/run.js b/node_modules/jsdoc/node_modules/esprima/test/run.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/run.js rename to node_modules/jsdoc/node_modules/esprima/test/run.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/runner.js b/node_modules/jsdoc/node_modules/esprima/test/runner.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/runner.js rename to node_modules/jsdoc/node_modules/esprima/test/runner.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/test.js b/node_modules/jsdoc/node_modules/esprima/test/test.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/test/test.js rename to node_modules/jsdoc/node_modules/esprima/test/test.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/check-version.js b/node_modules/jsdoc/node_modules/esprima/tools/check-version.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/check-version.js rename to node_modules/jsdoc/node_modules/esprima/tools/check-version.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/generate-test-fixture.js b/node_modules/jsdoc/node_modules/esprima/tools/generate-test-fixture.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/generate-test-fixture.js rename to node_modules/jsdoc/node_modules/esprima/tools/generate-test-fixture.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py b/node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py rename to node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/list-complexity.js b/node_modules/jsdoc/node_modules/esprima/tools/list-complexity.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/list-complexity.js rename to node_modules/jsdoc/node_modules/esprima/tools/list-complexity.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/update-coverage.sh b/node_modules/jsdoc/node_modules/esprima/tools/update-coverage.sh similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/esprima/tools/update-coverage.sh rename to node_modules/jsdoc/node_modules/esprima/tools/update-coverage.sh diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes b/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes rename to node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore b/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore index 9ef2b2e..64e78fe 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore +++ b/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore @@ -1,165 +1,166 @@ -.idea/ - -################# -## 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 + +################# +## 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/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md b/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md rename to node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md b/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md index 0cb547e..1b76d2f 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 (C) 2012 Michael Kourlas -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -> documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -> persons to whom the Software is furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -> Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -> WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 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 f5ed82b..01f89dd 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/README.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/README.md @@ -1,117 +1,196 @@ -# node-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` - string containing the root element of the XML -* `data` - object or JSON string to be converted to XML -* `options` - object containing options (optional) - * `declaration` - XML declaration options object (optional) - * `include` - boolean representing whether an XML declaration is included (optional, default: true) - * `encoding` - string representing the XML encoding for the corresponding attribute in the declaration; a value - of null represents no encoding attribute (optional, default: "UTF-8") - * `attributeString` - string containing the attribute property (optional, default: "@") - * `valueString` - string containing the value property (optional, default: "#") - * `prettyPrinting` - pretty-printing options object (optional) - * `enabled` - boolean representing whether pretty-printing is enabled (optional, default: true) - * `indentString` - string representing the indent (optional, default: "\t") - -## Example ## - -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 = { - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 07, 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";} - } - - 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 - >
            \ No newline at end of file +# 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. diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js b/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js index 38b15d5..dfd9ba4 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js @@ -1,33 +1,116 @@ -var js2xmlparser = require("../lib/js2xmlparser.js"); - -var data = { - "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";} -}; - -console.log(js2xmlparser("person", data)); \ No newline at end of file +/* 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)); +})(); diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js b/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js index cf8110f..f96c97b 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js @@ -1,223 +1,328 @@ -var xmlDeclaration = true; -var xmlVersion = "1.0"; -var xmlEncoding = "UTF-8"; -var attributeString = "@"; -var valueString = "#"; -var prettyPrinting = true; -var indentString = "\t"; - -module.exports = function (root, data, options) { - - return toXML(init(root, data, options)); -}; - -// Initialization -var init = function(root, data, options) { - - // Error checking for root element - if (typeof root !== "string") - throw new Error("root element must be a string"); - - // 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"); - } - } - } - - // Error checking and variable initialization for data - if (typeof data !== "string" && typeof data !== "object") - throw new Error("data must be an object or a 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; - - for (var property in object) { - - // Arrays - if (Object.prototype.toString.call(object[property]) === "[object Array]") { - - // Create separate object for each array element and pass to this function - for (var i = 0; i < object[property].length; i++) { - - var obj = {}; - obj[property] = object[property][i]; - - xml = toXML(obj, xml, level); - } - } - // JSON-type objects with properties - else if (Object.prototype.toString.call(object[property]) === "[object Object]") { - - xml += addIndent("<" + property, 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]) - xml += " " + attribute + "=\"" + toString(object[property][attributeString][attribute]) + "\""; - } - - if (lengthExcludingAttributes === 0) // Empty object - xml += addBreak("/>"); - else if (lengthExcludingAttributes === 1 && valueString in object[property]) // Value string only - xml += addBreak(">" + toString(object[property][valueString]) + ""); - else { // Object with properties - - xml += addBreak(">"); - - // Create separate object for each property and pass to this function - for (var subProperty in object[property]) { - - if (subProperty !== attributeString) { - - var tempObject = {}; - tempObject[subProperty] = object[property][subProperty]; - - xml = toXML(tempObject, xml, level + 1); - } - } - - xml += addBreak(addIndent("", level)); - } - } - // Everything else - else { - - xml += addBreak(addIndent("<" + property + ">" + toString(object[property]) + "", level)); - } - } - - // Finalize XML at end of process - if (level === 0) { - - // Remove extra line break at end of file - xml = xml.substring(0, xml.length - 1); - - // 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) { - - // Recursive function used to handle nested functions - var functionHelper = function(data) { - - if (Object.prototype.toString.call(data) === "[object Function]") - return (data() === undefined) ? data.toString() : functionHelper(data()); - else - return data; - }; - - // Functions - 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.toString(); - - // Escape illegal XML characters - data = data.replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); - - return data; -}; \ No newline at end of file +/* 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"; + }; +})(); diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/package.json b/node_modules/jsdoc/node_modules/js2xmlparser/package.json index 1a34ec9..9d22252 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/package.json +++ b/node_modules/jsdoc/node_modules/js2xmlparser/package.json @@ -13,21 +13,31 @@ "xml" ], "homepage": "http://www.kourlas.net", - "version": "0.1.0", + "version": "0.1.5", "author": { "name": "Michael Kourlas", - "email": "michaelkourlas@gmail.com" + "email": "michael@kourlas.net" }, "main": "./lib/js2xmlparser.js", "repository": { "type": "git", "url": "git://github.com/michaelkourlas/node-js2xmlparser.git" }, + "devDependencies": { + "mocha": "*", + "should": "*" + }, "license": "MIT", - "_id": "js2xmlparser@0.1.0", - "dist": { - "shasum": "1b04d67b3f793b0e3b46faf6ea9c4ef6d9e7f162", - "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.0.tgz" + "bugs": { + "url": "https://github.com/michaelkourlas/node-js2xmlparser/issues" + }, + "_id": "js2xmlparser@0.1.5", + "_shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", + "_from": "js2xmlparser@>=0.1.0 <0.2.0", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "michaelkourlas", + "email": "michael@kourlas.net" }, "maintainers": [ { @@ -35,8 +45,11 @@ "email": "michaelkourlas@gmail.com" } ], + "dist": { + "shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", + "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz" + }, "directories": {}, - "_shasum": "1b04d67b3f793b0e3b46faf6ea9c4ef6d9e7f162", - "_from": "js2xmlparser@0.1.0", - "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.0.tgz" + "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js b/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js rename to node_modules/jsdoc/node_modules/js2xmlparser/test/test.js diff --git a/node_modules/jsdoc/node_modules/jshint/LICENSE b/node_modules/jsdoc/node_modules/jshint/LICENSE deleted file mode 100644 index 0b310fe..0000000 --- a/node_modules/jsdoc/node_modules/jshint/LICENSE +++ /dev/null @@ -1,4 +0,0 @@ -** Licensed Under ** - - The MIT License - http://www.opensource.org/licenses/mit-license.php diff --git a/node_modules/jsdoc/node_modules/jshint/README.md b/node_modules/jsdoc/node_modules/jshint/README.md deleted file mode 100644 index ac1ee12..0000000 --- a/node_modules/jsdoc/node_modules/jshint/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# node-jshint - -A command line interface and npm package for jshint. - -## Install - -To use jshint from any location (for npm v1.x) you need to install using the global (-g) flag. - - npm install -g jshint - -## Usage - - jshint -h - -You can also require JSHint itself as a module. - - var jshint = require('jshint'); - -Note: If you are using npm v1.x be sure to install jshint locally (without the -g flag) or link it globally. - -## Text Editor Plugins - -* [gedit-node-jshint](https://github.com/niftylettuce/gedit-node-jshint) - Simply use CTRL+J in gedit to run JSHint using `node-jshint`. -* [vim syntastic](https://github.com/scrooloose/syntastic) - Run node-jshint at each file save. -* [sublime-jshint](https://github.com/uipoet/sublime-jshint) - `F7` or `command-B` on any .js file. `F4` next error line,column. `shift-F4` previous error line,column. - -## Custom Reporters - -Specify a custom reporter module (see example/reporter.js). - - --reporter path/to/reporter.js - -Use a jslint compatible xml reporter. - - --jslint-reporter - -Show additional non-error data generated by jshint (unused globals etc). - - --show-non-errors - -## Configuration Options - -**Note:** This behavior described below is very different from versions prior to `0.6`. - -The CLI uses the default options that come with JSHint. - -Only one extra option is unique to node-jshint: `globals` -allows you to define an object of globals that get ignored for every file. -To see an example you can look at how whitelisted globals are defined -in the [jshint code](https://github.com/jshint/jshint/blob/c047ea1b01097fcc220fcd1a55c41f67ae2e6e81/jshint.js#L556) - -To have your own configuration apply, there are several methods you can use: - -### Specify Manually - -Setting the `--config=/path/to/your/config` command line option to specify your own configuration file outside of the directory tree for your project. - -### Within your Project's Directory Tree - -When the CLI is called, and a configuration file isn't specified already, `node-jshint` will attempt to locate one for you starting in `pwd`. (or "present working directory") If this does not yield a `.jshintrc` file, it will move one level up (`..`) the directory tree all the way up to the filesystem root. If a file is found, it stops immediately and uses that set of configuration. - -This setup allows you to set up **one** configuration file for your entire project. (place it in the root folder) As long as you run `jshint` from anywhere within your project directory tree, the same configuration file will be used. - -### Home Directory - -If all the methods above do not yield a `.jshintrc` to use, the last place that will be checked is your user's `$HOME` directory. - -## File Extensions - -Default extension for files is ".js". If you want to use JSHint with other file extensions (.json), you need to pass this extra extension as an option : - - --extra-ext .json - -## Ignoring Files and Directories - -If there is a .jshintignore file in your project's directory tree, (also provided you run `jshint` from within your project's directory) then any directories or files specified will be skipped over. (behaves just like a `.gitignore` file) - -**Note:** Pattern matching uses minimatch, with the nocase [option](https://github.com/isaacs/minimatch). When there is no match, it performs a left side match (when no forward slashes present and path is a directory). - -## Installing dependencies for development - - ./configure - -## Build Commands - - jake -T - -## Project Guidelines - -* All tests are passing. -* No (new) JSHint errors are introduced. diff --git a/node_modules/jsdoc/node_modules/jshint/bin/hint b/node_modules/jsdoc/node_modules/jshint/bin/hint deleted file mode 100755 index 2b11eec..0000000 --- a/node_modules/jsdoc/node_modules/jshint/bin/hint +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./../lib/cli').interpret(process.argv); diff --git a/node_modules/jsdoc/node_modules/jshint/lib/cli.js b/node_modules/jsdoc/node_modules/jshint/lib/cli.js deleted file mode 100644 index 14d6ed4..0000000 --- a/node_modules/jsdoc/node_modules/jshint/lib/cli.js +++ /dev/null @@ -1,159 +0,0 @@ -var fs = require('fs'), - path = require('path'), - cli = require('cli').enable('glob', 'help'), - hint = require('./hint'); - -function existsSync() { - var obj = fs.existsSync ? fs : path; - return obj.existsSync.apply(obj, arguments); -} - -function _removeJsComments(str) { - str = str || ''; - - // replace everything between "/* */" in a non-greedy way - // The English version of the regex is: - // match '/*' - // then match 0 or more instances of any character (including newlines) - // except for instances of '*/' - // then match '*/' - str = str.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\//g, ''); - - str = str.replace(/\/\/[^\n\r]*/g, ''); //everything after "//" - return str; -} - -function _loadAndParseConfig(filePath) { - return filePath && existsSync(filePath) ? - JSON.parse(_removeJsComments(fs.readFileSync(filePath, "utf-8"))) : {}; -} - -/** - * This function searches for a file with a specified name, it starts - * with the dir passed, and traverses up the filesystem until it either - * finds the file, or hits the root - * - * @param {String} name Filename to search for (.jshintrc, .jshintignore) - * @param {String} dir Defaults to process.cwd() - */ -function _searchFile(name, dir) { - dir = dir || process.cwd(); - - var filename = path.normalize(path.join(dir, name)), - parent = path.resolve(dir, ".."); - - if (existsSync(filename)) { - return filename; - } - - return dir === parent ? null : _searchFile(name, parent); -} - -function _findConfig() { - var name = ".jshintrc", - projectConfig = _searchFile(name), - homeConfig = path.normalize(path.join(process.env.HOME, name)); - - if (projectConfig) { - return projectConfig; - } - - // if no project config, check $HOME - if (existsSync(homeConfig)) { - return homeConfig; - } - - return false; -} - -function _print(results) { - function exit() { - process.exit(results.length > 0 ? 1 : 0); - } - - // avoid stdout cutoff in node 0.4.x, also supports 0.5.x - // see https://github.com/joyent/node/issues/1669 - try { - if (!process.stdout.flush()) { - process.stdout.once("drain", exit); - } else { - exit(); - } - } catch (e) { - exit(); - } -} - -module.exports = { - interpret: function (args) { - var config, reporter, options, - customConfig, customReporter, - ignoreFile, ignores, extraExtensionList; - - cli.setArgv(args); - cli.options = {}; - options = cli.parse({ - 'version': ['v', 'display package version', 'boolean', false], - 'config': ['config', 'custom config file', 'string', false], - 'reporter': ['reporter', 'custom reporter', 'string', undefined], - 'jslint-reporter': ['jslint-reporter', 'use a jslint compatible xml reporter'], - 'checkstyle-reporter': ['checkstyle-reporter', 'use a CheckStyle compatible xml reporter'], - 'show-non-errors': ['show-non-errors', 'show additional data generated by jshint'], - 'extra-ext': ['extra-ext', 'comma-separated list of file extensions to use (.js is default)', 'string', ''] - }); - - customConfig = options.config; - customReporter = options.reporter ? path.resolve(process.cwd(), options.reporter) : null; - extraExtensionList = options["extra-ext"]; - - if (options.version) { - cli.setApp(path.resolve(__dirname + "/../package.json")); - process.stdout.write(cli.version + "\n"); - return; - } - - if (options.help || !cli.args.length) { - cli.getUsage(); - process.exit(); - return; - } - - if (options['jslint-reporter']) { - customReporter = "./reporters/jslint_xml.js"; - } - - if (options['checkstyle-reporter']) { - customReporter = "./reporters/checkstyle.js"; - } - - if (options['show-non-errors']) { - customReporter = "./reporters/non_error.js"; - } - - config = _loadAndParseConfig(customConfig ? customConfig : _findConfig()); - - if (customReporter) { - try { - reporter = require(customReporter).reporter; - } catch (r) { - process.stdout.write("Error opening reporter file: " + customReporter); - process.stdout.write(r + "\n"); - process.exit(1); - } - } - - ignoreFile = _searchFile(".jshintignore"); - - if (ignoreFile) { - ignores = fs.readFileSync(ignoreFile, "utf8").split("\n") - .filter(function (line) { - return !!line.trim(); - }) - .map(function (line) { - return path.resolve(path.dirname(ignoreFile), line.trim()); - }); - } - - _print(hint.hint(cli.args, config, reporter, ignores, extraExtensionList)); - } -}; diff --git a/node_modules/jsdoc/node_modules/jshint/lib/hint.js b/node_modules/jsdoc/node_modules/jshint/lib/hint.js deleted file mode 100644 index 0ecbbe8..0000000 --- a/node_modules/jsdoc/node_modules/jshint/lib/hint.js +++ /dev/null @@ -1,125 +0,0 @@ -var fs = require('fs'), - minimatch = require('minimatch'), - path = require('path'), - jshint = require('./../packages/jshint/jshint.js'), - _reporter = require('./reporters/default').reporter, - _cache = { - directories: {} - }; - -function _lint(file, results, config, data) { - var buffer, - globals, - lintdata; - - // config may be a pointer, but we modify it below, which changes it the next time it is used. - config = !config ? {} : Object.keys(config).reduce(function (obj, key) { - obj[key] = config[key]; - return obj; - }, {}); - - try { - buffer = fs.readFileSync(file, 'utf-8'); - } catch (e) { - process.stdout.write("Error: Cant open: " + file); - process.stdout.write(e + '\n'); - } - - // Remove potential Unicode Byte Order Mark. - buffer = buffer.replace(/^\uFEFF/, ''); - - // remove custom node-jshint option - if (config.globals) { - globals = config.globals; - delete config.globals; - } - - if (!jshint.JSHINT(buffer, config, globals)) { - jshint.JSHINT.errors.forEach(function (error) { - if (error) { - results.push({file: file, error: error}); - } - }); - } - - lintdata = jshint.JSHINT.data(); - - if (lintdata) { - lintdata.file = file; - data.push(lintdata); - } -} - -function isDirectory(aPath) { - var isDir; - - try { - if (_cache.directories.hasOwnProperty(aPath)) { - isDir = _cache.directories[aPath]; - } else { - isDir = fs.statSync(aPath).isDirectory(); - _cache.directories[aPath] = isDir; - } - } catch (e) { - isDir = false; - } - - return isDir; -} - - -function _shouldIgnore(somePath, ignore) { - function isIgnored(p) { - var fnmatch = minimatch(somePath, p, {nocase: true}), - absmatch = path.resolve(somePath) === p, - lsmatch = isDirectory(p) && p.match(/^[^\/]*\/?$/) && - somePath.match(new RegExp("^" + p + ".*")); - - return !!(fnmatch || lsmatch || absmatch); - } - - return ignore.some(function (ignorePath) { - return isIgnored(ignorePath); - }); -} - -function _collect(filePath, files, ignore, regExtension) { - if (ignore && _shouldIgnore(filePath, ignore)) { - return; - } - if (fs.statSync(filePath).isDirectory()) { - fs.readdirSync(filePath).forEach(function (item) { - _collect(path.join(filePath, item), files, ignore, regExtension); - }); - } else if (filePath.match(regExtension)) { - files.push(filePath); - } -} - -module.exports = { - hint: function (targets, config, reporter, ignore, extraExtensionList) { - var files = [], - results = [], - data = [], - regExtension; - - extraExtensionList = extraExtensionList || ""; - regExtension = new RegExp('\\.(js' + (extraExtensionList === "" ? "" : "|" + extraExtensionList.replace(/,/g, "|").replace(/[\. ]/g, "")) + ")$"); - - targets.forEach(function (target) { - _collect(target, files, ignore, regExtension); - }); - - files.forEach(function (file) { - _lint(file, results, config, data); - }); - - _cache = { - directories: {} - }; - - (reporter || _reporter)(results, data); - - return results; - } -}; diff --git a/node_modules/jsdoc/node_modules/jshint/lib/reporters/checkstyle.js b/node_modules/jsdoc/node_modules/jshint/lib/reporters/checkstyle.js deleted file mode 100644 index 0b2f6e1..0000000 --- a/node_modules/jsdoc/node_modules/jshint/lib/reporters/checkstyle.js +++ /dev/null @@ -1,107 +0,0 @@ -// Author: Boy Baukema -// http://github.com/relaxnow -module.exports = -{ - reporter: function (results, data) - { - "use strict"; - - var files = {}, - out = [], - pairs = { - "&": "&", - '"': """, - "'": "'", - "<": "<", - ">": ">" - }, - file, fileName, i, issue, globals, unuseds; - - function encode(s) { - for (var r in pairs) { - if (typeof(s) !== "undefined") { - s = s.replace(new RegExp(r, "g"), pairs[r]); - } - } - return s || ""; - } - - results.forEach(function (result) { - // Register the file - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - - // Add the error - files[result.file].push({ - severity: 'error', - line: result.error.line, - column: result.error.character, - message: result.error.reason, - source: result.error.raw - }); - }); - - data.forEach(function (result) { - file = data.file; - globals = result.implieds; - unuseds = result.unused; - - // Register the file - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - - if (globals) { - globals.forEach(function (global) { - files[result.file].push({ - severity: 'warning', - line: global.line, - column: 0, - message: "Implied global '" + global.name + "'", - source: 'jshint.implied-globals' - }); - }); - } - if (unuseds) { - unuseds.forEach(function (unused) { - files[result.file].push({ - severity: 'warning', - line: unused.line, - column: 0, - message: "Unused variable: '" + unused.name + "'", - source: 'jshint.implied-unuseds' - }); - }); - } - }); - - out.push(""); - out.push(""); - - for (fileName in files) { - if (files.hasOwnProperty(fileName)) { - out.push("\t"); - for (i = 0; i < files[fileName].length; i++) { - issue = files[fileName][i]; - out.push( - "\t\t" - ); - } - out.push("\t"); - } - } - - out.push(""); - - process.stdout.write(out.join("\n") + "\n"); - } -}; diff --git a/node_modules/jsdoc/node_modules/jshint/lib/reporters/default.js b/node_modules/jsdoc/node_modules/jshint/lib/reporters/default.js deleted file mode 100644 index 90805d8..0000000 --- a/node_modules/jsdoc/node_modules/jshint/lib/reporters/default.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - reporter: function (results) { - var len = results.length, - str = '', - file, error; - - results.forEach(function (result) { - file = result.file; - error = result.error; - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason + '\n'; - }); - - if (str) { - process.stdout.write(str + "\n" + len + ' error' + ((len === 1) ? '' : 's') + "\n"); - } - } -}; diff --git a/node_modules/jsdoc/node_modules/jshint/lib/reporters/jslint_xml.js b/node_modules/jsdoc/node_modules/jshint/lib/reporters/jslint_xml.js deleted file mode 100644 index eca2327..0000000 --- a/node_modules/jsdoc/node_modules/jshint/lib/reporters/jslint_xml.js +++ /dev/null @@ -1,54 +0,0 @@ -// Author: Vasili Sviridov -// http://github.com/vsviridov -module.exports = -{ - reporter: function (results) - { - "use strict"; - - var files = {}, - out = [], - pairs = { - "&": "&", - '"': """, - "'": "'", - "<": "<", - ">": ">" - }, - file, i, issue; - - function encode(s) { - for (var r in pairs) { - if (typeof(s) !== "undefined") { - s = s.replace(new RegExp(r, "g"), pairs[r]); - } - } - return s || ""; - } - - - results.forEach(function (result) { - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - files[result.file].push(result.error); - }); - - out.push(""); - out.push(""); - - for (file in files) { - out.push("\t"); - for (i = 0; i < files[file].length; i++) { - issue = files[file][i]; - out.push("\t\t"); - } - out.push("\t"); - } - - out.push(""); - - process.stdout.write(out.join("\n") + "\n"); - } -}; diff --git a/node_modules/jsdoc/node_modules/jshint/lib/reporters/non_error.js b/node_modules/jsdoc/node_modules/jshint/lib/reporters/non_error.js deleted file mode 100644 index 6b1f8c4..0000000 --- a/node_modules/jsdoc/node_modules/jshint/lib/reporters/non_error.js +++ /dev/null @@ -1,45 +0,0 @@ -/*jshint node: true */ -module.exports = -{ - reporter: function (results, data) { - var len = results.length, - str = '', - file, error, globals, unuseds; - - results.forEach(function (result) { - file = result.file; - error = result.error; - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason + '\n'; - }); - - str += len > 0 ? ("\n" + len + ' error' + ((len === 1) ? '' : 's')) : ""; - - data.forEach(function (data) { - file = data.file; - globals = data.implieds; - unuseds = data.unused; - - if (globals || unuseds) { - str += '\n\n' + file + ' :\n'; - } - - if (globals) { - str += '\tImplied globals:\n'; - globals.forEach(function (global) { - str += '\t\t' + global.name + ': ' + global.line + '\n'; - }); - } - if (unuseds) { - str += '\tUnused Variables:\n\t\t'; - unuseds.forEach(function (unused) { - str += unused.name + '(' + unused.line + '), '; - }); - } - }); - - if (str) { - process.stdout.write(str + "\n"); - } - } -}; diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/README.md deleted file mode 100644 index 0fe30d4..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/README.md +++ /dev/null @@ -1,196 +0,0 @@ -**cli is a toolkit for rapidly building command line apps - it includes:** - -- Full featured opts/args parser -- Plugin support for adding common options and switches -- Helper methods for working with input/output and spawning child processes -- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js) -- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js) - -Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app. - -## Example apps - -### sort.js - -```javascript -#!/usr/bin/env node -require('cli').withStdinLines(function(lines, newline) { - this.output(lines.sort().join(newline)); -}); -``` - -Try it out - -```bash -$ ./sort.js < input.txt -``` - -Let's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!) - -```javascript -var cli = require('cli'), options = cli.parse(); - -cli.withStdinLines(function(lines, newline) { - lines.sort(!options.n ? null : function(a, b) { - return parseInt(a) > parseInt(b); - }); - if (options.r) lines.reverse(); - this.output(lines.join(newline)); -}); -``` - -### static.js - -Let's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon` - -```javascript -var cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins - -cli.parse({ - log: ['l', 'Enable logging'], - port: ['p', 'Listen on this port', 'number', 8080], - serve: [false, 'Serve static files from PATH', 'path', './public'] -}); - -cli.main(function(args, options) { - var server, middleware = []; - - if (options.log) { - this.debug('Enabling logging'); - middleware.push(require('creationix/log')()); - } - - this.debug('Serving files from ' + options.serve); - middleware.push(require('creationix/static')('/', options.serve, 'index.html')); - - server = this.createServer(middleware).listen(options.port); - - this.ok('Listening on port ' + options.port); -}); -``` - -To output usage information - -```bash -$ ./static.js --help -``` - -To create a daemon that serves files from */tmp*, run - -```bash -$ ./static.js -ld --serve=/tmp -``` - -For more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples) - -## Helper methods - -cli has methods that collect stdin (newline is autodetected as \n or \r\n) - -```javascript -cli.withStdin(callback); //callback receives stdin as a string -cli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline) -``` - -cli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). - -```javascript -cli.withInput(file, function (line, newline, eof) { - if (!eof) { - this.output(line + newline); - } -}); -``` - -*Note: `file` can be omitted if you want to work with stdin* - -To output a progress bar, call - -```javascript -cli.progress(progress); //Where 0 <= progress <= 1 -``` - -To spawn a child process, use - -```javascript -cli.exec(cmd, callback); //callback receives the output of the process (split into lines) -``` - -cli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer) - -## Plugins - -Plugins are a way of adding common opts and can be enabled using - -```javascript -cli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method -``` - -**help** - *enabled by default* - -Adds `-h,--help` to output auto-generated usage information - -**version** - -Adds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json* - -To set your own app name and version, use `cli.setApp(app_name, version)` - -**status** - -Adds options to show/hide the stylized status messages that are output to the console when using one of these methods - -```javascript -cli.debug(msg); //Only shown when using --debug -cli.error(msg); -cli.fatal(msg); //Exits the process after outputting msg -cli.info(msg); -cli.ok(msg); -``` - -`-k,--no-color` will omit ANSI color escapes from the output - -**glob** - *requires* `npm install glob` - -Enables glob matching of arguments - -**daemon** - *requires* `npm install daemon` - -Adds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon - -`ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr) - -**timeout** - -Adds `-t,--timeout N` to exit the process after N seconds with an error - -**catchall** - -Adds `-c,--catch` to catch and output uncaughtExceptions and resume execution - -*Note: Plugins are automatically disabled if an option or switch of the same name is already defined* - -## LICENSE - -(MIT license) - -Copyright (c) 2010 Chris O'Hara - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/cli.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/cli.js deleted file mode 100644 index 91fa4db..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/cli.js +++ /dev/null @@ -1,1125 +0,0 @@ -/** - * Copyright (c) 2010 Chris O'Hara - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - //Note: cli includes kof/node-natives and creationix/stack. I couldn't find - //license information for either - contact me if you want your license added - -var cli = exports, - argv, curr_opt, curr_val, full_opt, is_long, - short_tags = [], opt_list, parsed = {}, - usage, argv_parsed, command_list, commands, - daemon, daemon_arg, no_color, show_debug; - -cli.app = null; -cli.version = null; -cli.argv = []; -cli.argc = 0; - -cli.options = {}; -cli.args = []; -cli.command; - -cli.width = 70; -cli.option_width = 25; - -/** - * Bind kof's node-natives (https://github.com/kof/node-natives) to `cli.native` - * - * Rather than requiring node natives (e.g. var fs = require('fs')), all - * native modules can be accessed like `cli.native.fs` - */ -cli.native = {}; -var define_native = function (module) { - Object.defineProperty(cli.native, module, { - enumerable: true, - configurable: true, - get: function() { - delete cli.native[module]; - return cli.native[module] = require(module); - } - }); -}; -var natives = process.binding('natives'); -for (var module in natives) { - define_native(module); -} - -cli.output = cli.native.util.print; -cli.exit = process.exit; - -/** - * Define plugins. Plugins can be enabled and disabled by calling: - * - * `cli.enable(plugin1, [plugin2, ...])` - * `cli.disable(plugin1, [plugin2, ...])` - * - * Methods are chainable - `cli.enable(plugin).disable(plugin2)`. - * - * The 'help' plugin is enabled by default. - */ -var enable = { - help: true, //Adds -h, --help - version: false, //Adds -v,--version => gets version by parsing a nearby package.json - daemon: false, //Adds -d,--daemon [ARG] => (see cli.daemon() below) - status: false, //Adds -k,--no-color & --debug => display plain status messages /display debug messages - timeout: false, //Adds -t,--timeout N => timeout the process after N seconds - catchall: false, //Adds -c,--catch => catch and output uncaughtExceptions - glob: false //Adds glob matching => use cli.glob(arg) -} -cli.enable = function (/*plugins*/) { - Array.prototype.slice.call(arguments).forEach(function (plugin) { - switch (plugin) { - case 'daemon': - try { - daemon = require('daemon'); - if (typeof daemon.daemonize !== 'function') { - throw 'Invalid module'; - } - } catch (e) { - cli.fatal('daemon.node not installed. Please run `npm install daemon`'); - } - break; - case 'catchall': - process.on('uncaughtException', function (err) { - cli.error('Uncaught exception: ' + (err.msg || err)); - }); - break; - case 'help': case 'version': case 'status': - case 'autocomplete': case 'timeout': - //Just add switches. - break; - case 'glob': - cli.glob = require('glob'); - break; - default: - cli.fatal('Unknown plugin "' + plugin + '"'); - break; - } - enable[plugin] = true; - }); - return cli; -} -cli.disable = function (/*plugins*/) { - Array.prototype.slice.call(arguments).forEach(function (plugin) { - if (enable[plugin]) { - enable[plugin] = false; - } - }); - return cli; -} - -/** - * Sets argv (default is process.argv). - * - * @param {Array|String} argv - * @param {Boolean} keep_arg0 (optional - default is false) - * @api public - */ -cli.setArgv = function (arr, keep_arg0) { - if (typeof arr == 'string') { - arr = arr.split(' '); - } else { - arr = arr.slice(); - } - cli.app = arr.shift(); - //Strip off argv[0] if it's a node binary - if (!keep_arg0 && ('node' === cli.native.path.basename(cli.app) - || process.execPath === cli.app)) { - cli.app = arr.shift(); - } - cli.app = cli.native.path.basename(cli.app); - argv_parsed = false; - cli.args = cli.argv = argv = arr; - cli.argc = argv.length; -}; -cli.setArgv(process.argv); - -/** - * Returns the next opt, or false if no opts are found. - * - * @return {String} opt - * @api public - */ -cli.next = function () { - if (!argv_parsed) { - cli.args = []; - argv_parsed = true; - } - - curr_val = null; - - //If we're currently in a group of short opts (e.g. -abc), return the next opt - if (short_tags.length) { - curr_opt = short_tags.shift(); - full_opt = '-' + curr_opt; - return curr_opt; - } - - if (!argv.length) { - return false; - } - - curr_opt = argv.shift(); - - //If an escape sequence is found (- or --), subsequent opts are ignored - if (curr_opt === '-' || curr_opt === '--') { - while (argv.length) { - cli.args.push(argv.shift()); - } - return false; - } - - //If the next element in argv isn't an opt, add it to the list of args - if (curr_opt[0] !== '-') { - cli.args.push(curr_opt); - return cli.next(); - } else { - //Check if the opt is short/long - is_long = curr_opt[1] === '-'; - curr_opt = curr_opt.substr(is_long ? 2 : 1); - } - - //Accept grouped short opts, e.g. -abc => -a -b -c - if (!is_long && curr_opt.length > 1) { - short_tags = curr_opt.split(''); - return cli.next(); - } - - var eq, len; - - //Check if the long opt is in the form --option=VALUE - if (is_long && (eq = curr_opt.indexOf('=')) >= 0) { - curr_val = curr_opt.substr(eq + 1); - curr_opt = curr_opt.substr(0, eq); - len = curr_val.length; - //Allow values to be quoted - if ((curr_val[0] === '"' && curr_val[len - 1] === '"') || - (curr_val[0] === "'" && curr_val[len - 1] === "'")) - { - curr_val = curr_val.substr(1, len-2); - } - if (curr_val.match(/^[0-9]+$/)) { - curr_val = parseInt(curr_val, 10); - } - } - - //Save the opt representation for later - full_opt = (is_long ? '--' : '-') + curr_opt; - - return curr_opt; -}; - -/** - * Parses command line opts. - * - * `opts` must be an object with opts defined like: - * long_tag: [short_tag, description, value_type, default_value]; - * - * `commands` is an optional array or object for apps that are of the form - * my_app [OPTIONS] [ARGS] - * The command list is output with usage information + there is bundled - * support for auto-completion, etc. - * - * See README.md for more information. - * - * @param {Object} opts - * @param {Object} commands (optional) - * @return {Object} opts (parsed) - * @api public - */ -cli.parse = function (opts, command_def) { - var default_val, i, parsed = cli.options, seen, - catch_all = !opts; - opt_list = opts || {}; - commands = command_def; - command_list = commands || []; - if (commands && !Array.isArray(commands)) { - command_list = Object.keys(commands); - } - while (o = cli.next()) { - seen = false; - for (opt in opt_list) { - if (!(opt_list[opt] instanceof Array)) { - continue; - } - if (!opt_list[opt][0]) { - opt_list[opt][0] = opt; - } - if (o === opt || o === opt_list[opt][0]) { - seen = true; - if (opt_list[opt].length === 2) { - parsed[opt] = true; - break; - } - default_val = null; - if (opt_list[opt].length === 4) { - default_val = opt_list[opt][3]; - } - if (opt_list[opt][2] instanceof Array) { - for (i = 0, l = opt_list[opt][2].length; i < l; i++) { - if (typeof opt_list[opt][2][i] === 'number') { - opt_list[opt][2][i] += ''; - } - } - parsed[opt] = cli.getArrayValue(opt_list[opt][2], is_long ? null : default_val); - break; - } - if (opt_list[opt][2].toLowerCase) { - opt_list[opt][2] = opt_list[opt][2].toLowerCase(); - } - switch (opt_list[opt][2]) { - case 'string': case 1: case true: - parsed[opt] = cli.getValue(default_val); - break; - case 'int': case 'number': case 'num': - case 'time': case 'seconds': case 'secs': case 'minutes': case 'mins': - case 'x': case 'n': - parsed[opt] = cli.getInt(default_val); - break; - case 'float': case 'decimal': - parsed[opt] = cli.getFloat(default_val); - break; - case 'path': case 'file': case 'directory': case 'dir': - parsed[opt] = cli.getPath(default_val, opt_list[opt][2]); - break; - case 'email': - parsed[opt] = cli.getEmail(default_val); - break; - case 'url': case 'uri': case 'domain': case 'host': - parsed[opt] = cli.getUrl(default_val, opt_list[opt][2]); - break; - case 'ip': - parsed[opt] = cli.getIp(default_val); - break; - case 'bool': case 'boolean': case 'on': - parsed[opt] = true; - break; - case 'false': case 'off': case false: case 0: - parsed[opt] = false; - break; - default: - cli.fatal('Unknown opt type "' + opt_list[opt][2] + '"'); - } - break; - } - } - if (process.env.NODE_DISABLE_COLORS) { - no_color = true; - } - if (!seen) { - if (enable.help && (o === 'h' || o === 'help')) { - cli.getUsage(); - process.exit(); - } else if (enable.version && (o === 'v' || o === 'version')) { - if (cli.version == null) { - cli.parsePackageJson(); - } - console.error(cli.app + ' v' + cli.version); - process.exit(); - } else if (enable.daemon && (o === 'd' || o === 'daemon')) { - daemon_arg = cli.getArrayValue(['start','stop','restart','pid','log'], is_long ? null : 'start'); - continue; - } else if (enable.catchall && (o === 'c' || o === 'catch')) { - continue; - } else if (enable.status && (o === 'k' || o === 'no-color' || o === 'debug')) { - no_color = (o === 'k' || o === 'no-color'); - show_debug = o === 'debug'; - continue; - } else if (enable.timeout && (o === 't' || o === 'timeout')) { - var secs = cli.getInt(); - setTimeout(function () { - cli.fatal('Process timed out after ' + secs + 's'); - }, secs * 1000); - continue; - } else if (catch_all) { - parsed[o] = curr_val || true; - continue; - } - cli.fatal('Unknown option ' + full_opt); - } - } - //Fill the remaining options with their default value or null - for (opt in opt_list) { - default_val = opt_list[opt].length === 4 ? opt_list[opt][3] : null; - if (!(opt_list[opt] instanceof Array)) { - parsed[opt] = opt_list[opt]; - continue; - } else if (typeof parsed[opt] === 'undefined') { - parsed[opt] = default_val; - } - } - if (command_list.length) { - if (cli.args.length === 0) { - if (enable.help) { - cli.getUsage(); - } else { - cli.fatal('A command is required (' + command_list.join(', ') + ').'); - } - process.exit(1); - } else { - cli.command = cli.autocompleteCommand(cli.args.shift()); - } - } - cli.argc = cli.args.length; - return parsed; -}; - -/** - * Helper method for matching a command from the command list. - * - * @param {String} command - * @return {String} full_command - * @api public - */ -cli.autocompleteCommand = function (command) { - var list; - if (!(command_list instanceof Array)) { - list = Object.keys(command_list); - } else { - list = command_list; - } - var i, j = 0, c = command.length, tmp_list; - if (list.length === 0 || list.indexOf(command) !== -1) { - return command; - } - for (i = 0; i < c; i++) { - tmp_list = []; - l = list.length; - if (l <= 1) break; - for (j = 0; j < l; j++) - if (list[j].length >= i && list[j][i] === command[i]) - tmp_list.push(list[j]); - list = tmp_list; - } - l = list.length; - if (l === 1) { - return list[0]; - } else if (l === 0) { - cli.fatal('Unknown command "' + command + '"' + (enable.help ? '. Please see --help for more information' : '')); - } else { - list.sort(); - cli.fatal('The command "' + command + '" is ambiguous and could mean "' + list.join('", "') + '"'); - } -}; - -/** - * Adds methods to output styled status messages to stderr. - * - * Added methods are cli.info(msg), cli.error(msg), cli.ok(msg), and - * cli.debug(msg). - * - * To control status messages, use the 'status' plugin - * 1) debug() messages are hidden by default. Display them with - * the --debug opt. - * 2) to hide all status messages, use the -s or --silent opt. - * - * @api private - */ -cli.status = function (msg, type) { - var pre; - switch (type) { - case 'info': - pre = no_color ? 'INFO:' : '\x1B[33mINFO\x1B[0m:'; - break; - case 'debug': - pre = no_color ? 'DEBUG:' : '\x1B[36mDEBUG\x1B[0m:'; - break; - case 'error': - case 'fatal': - pre = no_color ? 'ERROR:' : '\x1B[31mERROR\x1B[0m:'; - break; - case 'ok': - pre = no_color ? 'OK:' : '\x1B[32mOK\x1B[0m:'; - break; - } - msg = pre + ' ' + msg; - if (type === 'fatal') { - console.error(msg); - process.exit(1); - } - if (enable.status && !show_debug && type === 'debug') { - return; - } - console.error(msg); -}; -['info','error','ok','debug','fatal'].forEach(function (type) { - cli[type] = function (msg) { - cli.status(msg, type); - }; -}); - -/** - * Sets the app name and version. - * - * Usage: - * setApp('myapp', '0.1.0'); - * setApp('./package.json'); //Pull name/version from package.json - * - * @param {String} name - * @return cli (for chaining) - * @api public - */ -cli.setApp = function (name, version) { - if (name.indexOf('package.json') !== -1) { - cli.parsePackageJson(name); - } else { - cli.app = name; - cli.version = version; - } - return cli; -}; - -/** - * Parses the version number from package.json. If no path is specified, cli - * will attempt to locate a package.json in ./, ../ or ../../ - * - * @param {String} path (optional) - * @api public - */ -cli.parsePackageJson = function (path) { - var parse_packagejson = function (path) { - var packagejson = JSON.parse(cli.native.fs.readFileSync(path, 'utf8')); - cli.version = packagejson.version; - cli.app = packagejson.name; - }; - var try_all = function (arr, func, err) { - for (var i = 0, l = arr.length; i < l; i++) { - try { - func(arr[i]); - return; - } catch (e) { - if (i === l-1) { - cli.fatal(err); - } - } - } - }; - try { - if (path) { - return parse_packagejson(path); - } - try_all([ - __dirname + '/package.json', - __dirname + '/../package.json', - __dirname + '/../../package.json' - ], parse_packagejson); - } catch (e) { - cli.fatal('Could not detect ' + cli.app + ' version'); - } -}; - -/** - * Sets the usage string - default is `app [OPTIONS] [ARGS]`. - * - * @param {String} u - * @return cli (for chaining) - * @api public - */ -cli.setUsage = function (u) { - usage = u; - return cli; -}; - -var pad = function (str, len) { - if (typeof len === 'undefined') { - len = str; - str = ''; - } - if (str.length < len) { - len -= str.length; - while (len--) str += ' '; - } - return str; -}; - -/** - * Automatically build usage information from the opts list. If the help - * plugin is enabled (default), this info is displayed with -h, --help. - * - * @api public - */ -cli.getUsage = function () { - var short, desc, optional, line, seen_opts = [], - switch_pad = cli.option_width; - - var trunc_desc = function (pref, desc, len) { - var pref_len = pref.length, - desc_len = cli.width - pref_len, - truncated = ''; - if (desc.length <= desc_len) { - return desc; - } - var desc_words = (desc+'').split(' '), chars = 0, word; - while (desc_words.length) { - truncated += (word = desc_words.shift()) + ' '; - chars += word.length; - if (desc_words.length && chars + desc_words[0].length > desc_len) { - truncated += '\n' + pad(pref_len); - chars = 0; - } - } - return truncated; - }; - - usage = usage || cli.app + ' [OPTIONS]' + (command_list.length ? ' ' : '') + ' [ARGS]'; - if (no_color) { - console.error('Usage:\n ' + usage); - console.error('Options: '); - } else { - console.error('\x1b[1mUsage\x1b[0m:\n ' + usage); - console.error('\n\x1b[1mOptions\x1b[0m: '); - } - for (opt in opt_list) { - - if (opt.length === 1) { - long = opt_list[opt][0]; - short = opt; - } else { - long = opt; - short = opt_list[opt][0]; - } - - //Parse opt_list - desc = opt_list[opt][1].trim(); - type = opt_list[opt].length >= 3 ? opt_list[opt][2] : null; - optional = opt_list[opt].length === 4 ? opt_list[opt][3] : null; - - //Build usage line - if (short === long) { - if (short.length === 1) { - line = ' -' + short; - } else { - line = ' --' + long; - } - } else { - line = ' -' + short + ', --' + long; - } - line += ' '; - - if (type) { - if (type instanceof Array) { - desc += '. VALUE must be either [' + type.join('|') + ']'; - type = 'VALUE'; - } - if (type === true || type === 1) { - type = long.toUpperCase(); - } - type = type.toUpperCase(); - if (type === 'FLOAT' || type === 'INT') { - type = 'NUMBER'; - } - line += optional ? '[' + type + ']' : type; - } - line = pad(line, switch_pad); - line += trunc_desc(line, desc); - line += optional ? ' (Default is ' + optional + ')' : ''; - console.error(line.replace('%s', '%\0s')); - - seen_opts.push(short); - seen_opts.push(long); - } - if (enable.timeout && seen_opts.indexOf('t') === -1 && seen_opts.indexOf('timeout') === -1) { - console.error(pad(' -t, --timeout N', switch_pad) + 'Exit if the process takes longer than N seconds'); - } - if (enable.status) { - if (seen_opts.indexOf('k') === -1 && seen_opts.indexOf('no-color') === -1) { - console.error(pad(' -k, --no-color', switch_pad) + 'Omit color from output'); - } - if (seen_opts.indexOf('debug') === -1) { - console.error(pad(' --debug', switch_pad) + 'Show debug information'); - } - } - if (enable.catchall && seen_opts.indexOf('c') === -1 && seen_opts.indexOf('catch') === -1) { - console.error(pad(' -c, --catch', switch_pad) + 'Catch unanticipated errors'); - } - if (enable.daemon && seen_opts.indexOf('d') === -1 && seen_opts.indexOf('daemon') === -1) { - console.error(pad(' -d, --daemon [ARG]', switch_pad) + 'Daemonize the process. Control the daemon using [start, stop, restart, log, pid]'); - } - if (enable.version && seen_opts.indexOf('v') === -1 && seen_opts.indexOf('version') === -1) { - console.error(pad(' -v, --version', switch_pad) + 'Display the current version'); - } - if (enable.help && seen_opts.indexOf('h') === -1 && seen_opts.indexOf('help') === -1) { - console.error(pad(' -h, --help', switch_pad) + 'Display help and usage details'); - } - if (command_list.length) { - console.error('\n\x1b[1mCommands\x1b[0m: '); - if (!Array.isArray(commands)) { - for (var c in commands) { - line = ' ' + pad(c, switch_pad - 2); - line += trunc_desc(line, commands[c]); - console.error(line); - } - } else { - command_list.sort(); - console.error(' ' + trunc_desc(' ', command_list.join(', '))); - } - } - process.exit(); -}; - -/** - * Generates an error message when an opt is incorrectly used. - * - * @param {String} expects (e.g. 'a value') - * @param {String} type (e.g. 'VALUE') - * @api public - */ -cli.getOptError = function (expects, type) { - var err = full_opt + ' expects ' + expects - + '. Use `' + cli.app + ' ' + full_opt + (is_long ? '=' : ' ') + type + '`'; - return err; -}; - -/** - * Gets the next opt value and validates it with an optional validation - * function. If validation fails or no value can be obtained, this method - * will return the default value (if specified) or exit with err_msg. - * - * @param {String} default_val - * @param {Function} validate_func - * @param {String} err_msg - * @api public - */ -cli.getValue = function (default_val, validate_func, err_msg) { - err_msg = err_msg || cli.getOptError('a value', 'VALUE'); - - var value; - - try { - if (curr_val) { - if (validate_func) { - curr_val = validate_func(curr_val); - } - return curr_val; - } - - //Grouped short opts aren't allowed to have values - if (short_tags.length) { - throw 'Short tags'; - } - - //If there's no args left or the next arg is an opt, return the - //default value (if specified) - otherwise fail - if (!argv.length || argv[0][0] === '-') { - throw 'No value'; - } - - value = argv.shift(); - - if (value.match(/^[0-9]+$/)) { - value = parseInt(value, 10); - } - - //Run the value through a validation/transformation function if specified - if (validate_func) { - value = validate_func(value); - } - } catch (e) { - - //The value didn't pass the validation/transformation. Unshift the value and - //return the default value (if specified) - if (value) { - argv.unshift(value); - } - return default_val != null ? default_val : cli.fatal(err_msg); - } - return value; -}; - -cli.getInt = function (default_val) { - return cli.getValue(default_val, function (value) { - if (typeof value === 'number') return value; - if (!value.match(/^(?:-?(?:0|[1-9][0-9]*))$/)) { - throw 'Invalid int'; - } - return parseInt(value); - }, cli.getOptError('a number', 'NUMBER')); -} - -cli.getFloat = function (default_val) { - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:-?(?:0|[1-9][0-9]*))?(?:\.[0-9]*)?$/)) { - throw 'Invalid float'; - } - return parseFloat(value, 10); - }, cli.getOptError('a number', 'NUMBER')); -} - -cli.getUrl = function (default_val, identifier) { - identifier = identifier || 'url'; - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?:\w+:\w+@)?((?:(?:[-\w\d{1-3}]+\.)+(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|edu|co\.uk|ac\.uk|it|fr|tv|museum|asia|local|travel|[a-z]{2})?)|((\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)(\.(\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)){3}))(?::[\d]{1,5})?(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?:#(?:[-\w~!$ |\/.,*:;=]|%[a-f\d]{2})*)?$/i)) { - throw 'Invalid URL'; - } - return value; - }, cli.getOptError('a ' + identifier, identifier.toUpperCase())); -} - -cli.getEmail = function (default_val) { - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/)) { - throw 'Invalid email'; - } - return value; - }, cli.getOptError('an email', 'EMAIL')); -} - -cli.getIp = function (default_val) { - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/)) { - throw 'Invalid IP'; - } - return value; - }, cli.getOptError('an IP', 'IP')); -} - -cli.getPath = function (default_val, identifier) { - identifier = identifier || 'path'; - return cli.getValue(default_val, function (value) { - if (value.match(/[?*:;{}]/)) { - throw 'Invalid path'; - } - return value; - }, cli.getOptError('a ' + identifier, identifier.toUpperCase())); -} - -cli.getArrayValue = function (arr, default_val) { - return cli.getValue(default_val, function (value) { - if (arr.indexOf(value) === -1) { - throw 'Unexpected value'; - } - return value; - }, cli.getOptError('either [' + arr.join('|') + ']', 'VALUE')); -} - -/** - * Gets all data from STDIN (with optional encoding) and sends it to callback. - * - * @param {String} encoding (optional - default is 'utf8') - * @param {Function} callback - * @api public - */ -cli.withStdin = function (encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding; - encoding = 'utf8'; - } - var stream = process.openStdin(), data = ''; - stream.setEncoding(encoding); - stream.on('data', function (chunk) { - data += chunk; - }); - stream.on('end', function () { - callback.apply(cli, [data]); - }); -}; - -/** - * Gets all data from STDIN, splits the data into lines and sends it - * to callback (callback isn't called until all of STDIN is read. To - * process each line as it's received, see the method below - * - * @param {Function} callback - * @api public - */ -cli.withStdinLines = function (callback) { - cli.withStdin(function (data) { - var sep = data.indexOf('\r\n') !== -1 ? '\r\n' : '\n'; - callback.apply(cli, [data.split(sep), sep]); - }); -}; - -/** - * Asynchronously reads a file line by line. When a line is received, - * callback is called with (line, sep) - when EOF is reached, callback - * receives (null, null, true) - * - * @param {String} file (optional - default is 'stdin') - * @param {String} encoding (optional - default is 'utf8') - * @param {Function} callback (line, sep, eof) - * @api public - */ -cli.withInput = function (file, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding; - encoding = 'utf8'; - } else if (typeof file === 'function') { - callback = file; - encoding = 'utf8'; - file = 'stdin'; - } - if (file === 'stdin') { - file = process.openStdin(); - } else { - try { - file = cli.native.fs.createReadStream(file); - file.on('error', cli.fatal); - } catch (e) { - return cli.fatal(e); - } - } - file.setEncoding(encoding); - var lines = [], data = '', eof, sep; - file.on('data', function (chunk) { - if (eof) return; - data += chunk; - if (!sep) { - if (data.indexOf('\r\n') !== -1) { - sep = '\r\n'; - } else if (data.indexOf('\n') !== -1) { - sep = '\n'; - } else { - last_line = data; - return; - } - } - lines = data.split(sep); - data = eof ? null : lines.pop(); - while (lines.length) { - callback.apply(cli, [lines.shift(), sep, false]); - } - }); - file.on('end', function () { - eof = true; - if (data.length) { - callback.apply(cli, [data, sep || '', false]); - } - callback.apply(cli, [null, null, true]); - }); -}; - -/** - * A method for creating and controlling a daemon. - * - * `arg` can be: - * start = daemonizes the process - * stop = stops the daemon if it is running - * restart = alias for stop -> start - * pid = outputs the daemon's PID if it is running - * log = outputs the daemon's log file (stdout + stderr) - * - * @param {String} arg (Optional - default is 'start') - * @param {Function} callback - * @api public - */ -cli.daemon = function (arg, callback) { - if (typeof daemon === 'undefined') { - cli.fatal('Daemon is not initialized'); - } - - if (typeof arg === 'function') { - callback = arg; - arg = 'start'; - } - - var lock_file = '/tmp/' + cli.app + '.pid', - log_file = '/tmp/' + cli.app + '.log'; - - var start = function () { - daemon.daemonize(log_file, lock_file, function (err) { - if (err) return cli.error('Error starting daemon: ' + err); - callback(); - }); - }; - - var stop = function () { - try { - cli.native.fs.readFileSync(lock_file); - } catch (e) { - return cli.error('Daemon is not running'); - }; - daemon.kill(lock_file, function (err, pid) { - if (err && err.errno === 3) { - return cli.error('Daemon is not running'); - } else if (err) { - return cli.error('Error stopping daemon: ' + err.errno); - } - cli.ok('Successfully stopped daemon with pid: ' + pid); - }); - }; - - switch(arg) { - case 'stop': - stop(); - break; - case 'restart': - daemon.stop(lock_file, function () { - start(); - }); - break; - case 'log': - try { - cli.native.fs.createReadStream(log_file, {encoding: 'utf8'}).pipe(process.stdout); - } catch (e) { - return cli.error('No daemon log file'); - }; - break; - case 'pid': - try { - var pid = cli.native.fs.readFileSync(lock_file, 'utf8'); - cli.native.fs.statSync('/proc/' + pid); - cli.info(pid); - } catch (e) { - return cli.error('Daemon is not running'); - }; - break; - default: - start(); - break; - } -} - -/** - * The main entry method. Calling cli.main() is only necessary in - * scripts that have daemon support enabled. `callback` receives (args, options) - * - * @param {Function} callback - * @api public - */ -cli.main = function (callback) { - var after = function () { - callback.apply(cli, [cli.args, cli.options]); - }; - if (enable.daemon && daemon_arg) { - cli.daemon(daemon_arg, after); - } else { - after(); - } -} - -/** - * Bind creationix's stack (https://github.com/creationix/stack). - * - * Create a simple middleware stack by calling: - * - * cli.createServer(middleware).listen(port); - * - * @return {Server} server - * @api public - */ -cli.createServer = function(/*layers*/) { - var defaultStackErrorHandler = function (req, res, err) { - if (err) { - console.error(err.stack); - res.writeHead(500, {"Content-Type": "text/plain"}); - return res.end(err.stack + "\n"); - } - res.writeHead(404, {"Content-Type": "text/plain"}); - res.end("Not Found\n"); - }; - var handle = error = defaultStackErrorHandler, - layers = Array.prototype.slice.call(arguments); - - //Allow createServer(a,b,c) and createServer([a,b,c]) - if (layers.length && layers[0] instanceof Array) { - layers = layers[0]; - } - layers.reverse().forEach(function (layer) { - var child = handle; - handle = function (req, res) { - try { - layer(req, res, function (err) { - if (err) return error(req, res, err); - child(req, res); - }); - } catch (err) { - error(req, res, err); - } - }; - }); - return cli.native.http.createServer(handle); -}; - -/** - * A wrapper for child_process.exec(). - * - * If the child_process exits successfully, `callback` receives an array of - * stdout lines. The current process exits if the child process has an error - * and `errback` isn't defined. - * - * @param {String} cmd - * @param {Function} callback (optional) - * @param {Function} errback (optional) - * @api public - */ -cli.exec = function (cmd, callback, errback) { - cli.native.child_process.exec(cmd, function (err, stdout, stderr) { - err = err || stderr; - if (err) { - if (errback) { - return errback(err); - } - return cli.fatal('exec() failed\n' + err); - } - if (callback) { - callback(stdout.split('\n')); - } - }); -}; - -/** - * Helper method for outputting a progress bar to the console. - * - * @param {Number} progress (0 <= progress <= 1) - * @api public - */ -var last_progress_call, progress_len = 74; -cli.progress = function (progress) { - if (progress < 0 || progress > 1 || isNaN(progress)) return; - var now = (new Date()).getTime(); - if (last_progress_call && (now - last_progress_call) < 100 && progress !== 1) { - return; //Throttle progress calls - } - last_progress_call = now; - - - var barLength = Math.floor(progress_len * progress), - str = ''; - if (barLength == 0 && progress > 0) { - barLength = 1; - } - for (var i = 1; i <= progress_len; i++) { - str += i <= barLength ? '#' : ' '; - } - cli.native.util.print('[' + str + '] ' + Math.floor(progress * 100) + '%' + (progress === 1 ? '\n' : '\u000D')); -}; - -/** - * Helper method for outputting a spinner to the console. - * - * @param {String|Boolean} prefix (optional) - * @api public - */ -var spinnerInterval; -cli.spinner = function (prefix, end) { - if (end) { - cli.native.util.print('\u000D' + prefix); - return clearInterval(spinnerInterval); - } - prefix = prefix + ' ' || ''; - var spinner = ['-','\\','|','/'], i = 0, l = spinner.length; - spinnerInterval = setInterval(function () { - cli.native.util.print('\u000D' + prefix + spinner[i++]); - if (i == l) i = 0; - }, 200); -}; diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/cat.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/cat.js deleted file mode 100755 index 14c4e79..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/cat.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -var output_file = function (file) { - cli.withInput(file, function (line, sep, eof) { - if (!eof) { - cli.output(line + sep); - } else if (cli.args.length) { - output_file(cli.args.shift()); - } - }); -}; - -if (cli.args.length) { - output_file(cli.args.shift()); -} \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/command.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/command.js deleted file mode 100755 index 2f04491..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/command.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -//The second (optional) argument of cli.parse() is a command list -//Type `./command.js --help` for usage info - -//cli enables auto-completion of commands (similiar to npm), e.g. all of -//the following are equivalent and result in "Command is: install": -// $ ./command.js install -// $ ./command.js inst -// $ ./command.js i - -cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']); - -console.log('Command is: ' + cli.command); diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/echo.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/echo.js deleted file mode 100755 index dac9cca..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/echo.js +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env node - -/* All of the following commands are equivalent and write `foo\tbar foo` to out.txt - $ ./echo.js -n -e --output=out.txt "foo\tbar" "foo" - $ ./echo.js --newline --escape --output "out.txt" "foo\tbar" "foo" - $ ./echo.js -ne --output=out.txt "foo\tbar" "foo" - $ ./echo.js -en --output="out.txt" "foo\tbar" "foo" -*/ - -var cli = require('cli'); - -cli.parse({ - newline: ['n', 'Do not output the trailing newline'], - escape: ['e', 'Enable interpretation of backslash escapes'], - separator: ['s', 'Separate arguments using this value', 'string', ' '], - output: [false, 'Write to FILE rather than the console', 'file'] -}); - -cli.main(function (args, options) { - var output = '', i, j, l, output_stream; - - if (this.argc) { - if (options.escape) { - var replace = {'\\n':'\n','\\r':'\r','\\t':'\t','\\e':'\e','\\v':'\v','\\f':'\f','\\c':'\c','\\b':'\b','\\a':'\a','\\\\':'\\'}; - var escape = function (str) { - string += ''; - for (j in replace) { - string = string.replace(i, replace[i]); - } - return string; - } - for (i = 0, l = this.argc; i < l; i++) { - args[i] = escape(args[i]); - } - options.separator = escape(options.separator); - } - output += args.join(options.separator); - } - - if (!options.newline) { - output += '\n'; - } - - try { - if (options.output) { - output_stream = this.native.fs.createWriteStream(options.output) - } else { - output_stream = process.stdout; - } - output_stream.write(output); - } catch (e) { - this.fatal('Could not write to output stream'); - } -}); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/glob.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/glob.js deleted file mode 100755 index 12585c0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/glob.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli').enable('glob'); - -//Running `./glob.js *.js` will output a list of .js files in this directory -console.log(cli.args); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/long_desc.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/long_desc.js deleted file mode 100755 index 63632f4..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/long_desc.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node - -var cli = require('../'); - -//You can (optionally) boost the width of output with: -//cli.width = 120; - -//You can also adjust the width of the options/command definitions -//cli.option_width = 25; - -var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s ' - + 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make' - + ' a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, ' - + 'remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing ' - + 'Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions' - + ' of Lorem Ipsum.'; - -cli.parse({ - foo: ['f', long_desc] -}); diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/progress.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/progress.js deleted file mode 100755 index 300c674..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/progress.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -var i = 0, interval = setInterval(function () { - cli.progress(++i / 100); - if (i === 100) { - clearInterval(interval); - cli.ok('Finished!'); - } -}, 50); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/sort.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/sort.js deleted file mode 100755 index 5d22313..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/sort.js +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -var options = cli.parse({ - numeric: ['n', 'Compare using a numeric sort'], - reverse: ['r', 'Reverse the results'] -}); - -cli.withStdinLines(function (lines, newline) { - lines.sort(!options.numeric ? null : function (a, b) { - return parseInt(a) > parseInt(b); - }); - if (options.reverse) { - lines.reverse(); - } - this.output(lines.join(newline)); -}); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/spinner.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/spinner.js deleted file mode 100755 index 6100001..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/spinner.js +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -cli.spinner('Working..'); - -setTimeout(function () { - cli.spinner('Working.. done!', true); //End the spinner -}, 3000); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/static.coffee b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/static.coffee deleted file mode 100755 index cbf3b16..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/static.coffee +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env coffee - -cli = require 'cli' - -cli.enable('daemon','status') - .setUsage('static.coffee [OPTIONS]') - -cli.parse { - log: ['l', 'Enable logging'] - port: ['p', 'Listen on this port', 'number', 8080] - serve: [false, 'Serve static files from PATH', 'path', './public'] -} - -middleware = [] - -cli.main (args, options) -> - - if options.log - @debug 'Enabling logging' - middleware.push require('creationix/log')() - - @debug 'Serving files from ' + options.serve - middleware.push require('creationix/static')('/', options.serve, 'index.html') - - server = @createServer(middleware).listen options.port - - @ok 'Listening on port ' + options.port \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/static.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/static.js deleted file mode 100755 index eb6fd24..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/examples/static.js +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli').enable('status', 'daemon'); - -cli.parse({ - log: ['l', 'Enable logging'], - port: ['p', 'Listen on this port', 'number', 8080], - serve: [false, 'Serve static files from PATH', 'path', './public'] -}); - -cli.main(function (args, options) { - var server, middleware = []; - - if (options.log) { - this.debug('Enabling logging'); - middleware.push(require('creationix/log')()); - } - - this.debug('Serving files from ' + options.serve); - middleware.push(require('creationix/static')('/', options.serve, 'index.html')); - - server = this.createServer(middleware).listen(options.port); - - this.ok('Listening on port ' + options.port); -}); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/index.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/index.js deleted file mode 100644 index 3966bd7..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./cli'); diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore deleted file mode 100644 index c34fdd5..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.*.swp -test/a/ -node_modules/* diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml deleted file mode 100644 index fca8ef0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.10 - - 0.11 diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/README.md deleted file mode 100644 index 82b7ef6..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +++ /dev/null @@ -1,241 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Features - -Please see the [minimatch -documentation](https://github.com/isaacs/minimatch) for more details. - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instanting the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `error` The error encountered. When an error is encountered, the - glob object is in an undefined state, and should be discarded. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `statCache` Collection of all the stat results the glob search - performed. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `1` - Path exists, and is not a directory - * `2` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `abort` Stop the search. - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the glob object, as well. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. It will cause - ELOOP to be triggered one level sooner in the case of cyclical - symbolic links. -* `silent` When an unusual error is encountered - when attempting to read a directory, a warning will be printed to - stderr. Set the `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered - when attempting to read a directory, the process will just continue on - in search of other matches. Set the `strict` option to raise an error - in these cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary to - set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `sync` Perform a synchronous glob search. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. - Set this flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `nocase` Perform a case-insensitive match. Note that case-insensitive - filesystems will sometimes result in glob returning results that are - case-insensitively matched anyway, since readdir and stat will not - raise an error. -* `debug` Set to enable debug logging in minimatch and glob. -* `globDebug` Set to enable debug logging in glob, but not minimatch. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js deleted file mode 100644 index be122df..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "test/a/**/[cg]/../[cg]" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "{./*/*,/*,/usr/local/*}" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js deleted file mode 100644 index 564f3b1..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +++ /dev/null @@ -1,746 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// readdir(PREFIX) as ENTRIES -// If fails, END -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $]) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - - - -module.exports = glob - -var fs = require("graceful-fs") -, minimatch = require("minimatch") -, Minimatch = minimatch.Minimatch -, inherits = require("inherits") -, EE = require("events").EventEmitter -, path = require("path") -, isDir = {} -, assert = require("assert").ok -, once = require("once") - -function glob (pattern, options, cb) { - if (typeof options === "function") cb = options, options = {} - if (!options) options = {} - - if (typeof options === "number") { - deprecated() - return - } - - var g = new Glob(pattern, options, cb) - return g.sync ? g.found : g -} - -glob.fnmatch = deprecated - -function deprecated () { - throw new Error("glob's interface has changed. Please see the docs.") -} - -glob.sync = globSync -function globSync (pattern, options) { - if (typeof options === "number") { - deprecated() - return - } - - options = options || {} - options.sync = true - return glob(pattern, options) -} - -this._processingEmitQueue = false - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (!(this instanceof Glob)) { - return new Glob(pattern, options, cb) - } - - if (typeof options === "function") { - cb = options - options = null - } - - if (typeof cb === "function") { - cb = once(cb) - this.on("error", cb) - this.on("end", function (matches) { - cb(null, matches) - }) - } - - options = options || {} - - this._endEmitted = false - this.EOF = {} - this._emitQueue = [] - - this.paused = false - this._processingEmitQueue = false - - this.maxDepth = options.maxDepth || 1000 - this.maxLength = options.maxLength || Infinity - this.cache = options.cache || {} - this.statCache = options.statCache || {} - - this.changedCwd = false - var cwd = process.cwd() - if (!options.hasOwnProperty("cwd")) this.cwd = cwd - else { - this.cwd = options.cwd - this.changedCwd = path.resolve(options.cwd) !== cwd - } - - this.root = options.root || path.resolve(this.cwd, "/") - this.root = path.resolve(this.root) - if (process.platform === "win32") - this.root = this.root.replace(/\\/g, "/") - - this.nomount = !!options.nomount - - if (!pattern) { - throw new Error("must provide pattern") - } - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - this.strict = options.strict !== false - this.dot = !!options.dot - this.mark = !!options.mark - this.sync = !!options.sync - this.nounique = !!options.nounique - this.nonull = !!options.nonull - this.nosort = !!options.nosort - this.nocase = !!options.nocase - this.stat = !!options.stat - - this.debug = !!options.debug || !!options.globDebug - - if (/\bglob\b/.test(process.env.NODE_DEBUG || '')) - this.debug = true - - if (this.debug) - this.log = console.error - - this.silent = !!options.silent - - var mm = this.minimatch = new Minimatch(pattern, options) - this.options = mm.options - pattern = this.pattern = mm.pattern - - this.error = null - this.aborted = false - - // list of all the patterns that ** has resolved do, so - // we can avoid visiting multiple times. - this._globstars = {} - - EE.call(this) - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (this.minimatch.set.length === 0) { - return process.nextTick(this._finish.bind(this)) - } - - this.minimatch.set.forEach(iterator.bind(this)) - function iterator (pattern, i, set) { - this._process(pattern, 0, i, function (er) { - if (er) this.emit("error", er) - if (-- n <= 0) this._finish() - }) - } -} - -Glob.prototype.log = function () {} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - - var nou = this.nounique - , all = nou ? [] : {} - - for (var i = 0, l = this.matches.length; i < l; i ++) { - var matches = this.matches[i] - this.log("matches[%d] =", i, matches) - // do like the shell, and spit out the literal glob - if (!matches) { - if (this.nonull) { - var literal = this.minimatch.globSet[i] - if (nou) all.push(literal) - else all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) all.push.apply(all, m) - else m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) all = Object.keys(all) - - if (!this.nosort) { - all = all.sort(this.nocase ? alphasorti : alphasort) - } - - if (this.mark) { - // at *some* point we statted all of these - all = all.map(this._mark, this) - } - - this.log("emitting end", all) - - this.EOF = this.found = all - this.emitMatch(this.EOF) -} - -function alphasorti (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return alphasort(a, b) -} - -function alphasort (a, b) { - return a > b ? 1 : a < b ? -1 : 0 -} - -Glob.prototype._mark = function (p) { - var c = this.cache[p] - var m = p - if (c) { - var isDir = c === 2 || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - this.statCache[m] = this.statCache[p] - this.cache[m] = this.cache[p] - } - } - - return m -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit("abort") -} - -Glob.prototype.pause = function () { - if (this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = true - this.emit("pause") -} - -Glob.prototype.resume = function () { - if (!this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = false - this.emit("resume") - this._processEmitQueue() - //process.nextTick(this.emit.bind(this, "resume")) -} - -Glob.prototype.emitMatch = function (m) { - this.log('emitMatch', m) - this._emitQueue.push(m) - this._processEmitQueue() -} - -Glob.prototype._processEmitQueue = function (m) { - this.log("pEQ paused=%j processing=%j m=%j", this.paused, - this._processingEmitQueue, m) - var done = false - while (!this._processingEmitQueue && - !this.paused) { - this._processingEmitQueue = true - var m = this._emitQueue.shift() - this.log(">processEmitQueue", m === this.EOF ? ":EOF:" : m) - if (!m) { - this.log(">processEmitQueue, falsey m") - this._processingEmitQueue = false - break - } - - if (m === this.EOF || !(this.mark && !this.stat)) { - this.log("peq: unmarked, or eof") - next.call(this, 0, false) - } else if (this.statCache[m]) { - var sc = this.statCache[m] - var exists - if (sc) - exists = sc.isDirectory() ? 2 : 1 - this.log("peq: stat cached") - next.call(this, exists, exists === 2) - } else { - this.log("peq: _stat, then next") - this._stat(m, next) - } - } - done = true - - function next(exists, isDir) { - this.log("next", m, exists, isDir) - var ev = m === this.EOF ? "end" : "match" - - // "end" can only happen once. - assert(!this._endEmitted) - if (ev === "end") - this._endEmitted = true - - if (exists) { - // Doesn't mean it necessarily doesn't exist, it's possible - // we just didn't check because we don't care that much, or - // this is EOF anyway. - if (isDir && !m.match(/\/$/)) { - m = m + "/" - } else if (!isDir && m.match(/\/$/)) { - m = m.replace(/\/+$/, "") - } - } - this.log("emit", ev, m) - this.emit(ev, m) - this._processingEmitQueue = false - if (done && m !== this.EOF && !this.paused) - this._processEmitQueue() - } -} - -Glob.prototype._process = function (pattern, depth, index, cb_) { - assert(this instanceof Glob) - - var cb = function cb (er, res) { - assert(this instanceof Glob) - if (this.paused) { - if (!this._processQueue) { - this._processQueue = [] - this.once("resume", function () { - var q = this._processQueue - this._processQueue = null - q.forEach(function (cb) { cb() }) - }) - } - this._processQueue.push(cb_.bind(this, er, res)) - } else { - cb_.call(this, er, res) - } - }.bind(this) - - if (this.aborted) return cb() - - if (depth > this.maxDepth) return cb() - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === "string") { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - prefix = pattern.join("/") - this._stat(prefix, function (exists, isDir) { - // either it's there, or it isn't. - // nothing more to do, either way. - if (exists) { - if (prefix && isAbsolute(prefix) && !this.nomount) { - if (prefix.charAt(0) === "/") { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - } - } - - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][prefix] = true - this.emitMatch(prefix) - } - return cb() - }) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's "absolute" like /foo/bar, - // or "relative" like "../baz" - prefix = pattern.slice(0, n) - prefix = prefix.join("/") - break - } - - // get the list of entries. - var read - if (prefix === null) read = "." - else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { - if (!prefix || !isAbsolute(prefix)) { - prefix = "/" + prefix - } - read = prefix - - // if (process.platform === "win32") - // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") - - this.log('absolute: ', prefix, this.root, pattern, read) - } else { - read = prefix - } - - this.log('readdir(%j)', read, this.cwd, this.root) - - return this._readdir(read, function (er, entries) { - if (er) { - // not a directory! - // this means that, whatever else comes after this, it can never match - return cb() - } - - // globstar is special - if (pattern[n] === minimatch.GLOBSTAR) { - // test without the globstar, and with every child both below - // and replacing the globstar. - var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] - entries.forEach(function (e) { - if (e.charAt(0) === "." && !this.dot) return - // instead of the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) - // below the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) - }, this) - - s = s.filter(function (pattern) { - var key = gsKey(pattern) - var seen = !this._globstars[key] - this._globstars[key] = true - return seen - }, this) - - if (!s.length) - return cb() - - // now asyncForEach over this - var l = s.length - , errState = null - s.forEach(function (gsPattern) { - this._process(gsPattern, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l <= 0) return cb() - }) - }, this) - - return - } - - // not a globstar - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = pattern[n] - var negate = !!this.minimatch.negate; - var rawGlob = pattern[n]._glob - , dotOk = this.dot || rawGlob.charAt(0) === "." - - entries = entries.filter(function (e) { - if (e.charAt(0) !== "." || dotOk) { - if (negate && n === 0) { - return !e.match(pattern[n]); - } else { - return e.match(pattern[n]); - } - } - - return null; - }) - - // If n === pattern.length - 1, then there's no need for the extra stat - // *unless* the user has specified "mark" or "stat" explicitly. - // We know that they exist, since the readdir returned them. - if (n === pattern.length - 1 && - !this.mark && - !this.stat) { - entries.forEach(function (e) { - if (prefix) { - if (prefix !== "/") e = prefix + "/" + e - else e = prefix + e - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path.join(this.root, e) - } - - if (process.platform === "win32") - e = e.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][e] = true - this.emitMatch(e) - }, this) - return cb.call(this) - } - - - // now test all the remaining entries as stand-ins for that part - // of the pattern. - var l = entries.length - , errState = null - if (l === 0) return cb() // no matches possible - entries.forEach(function (e) { - var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) - this._process(p, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l === 0) return cb.call(this) - }) - }, this) - }) - -} - -function gsKey (pattern) { - return '**' + pattern.map(function (p) { - return (p === minimatch.GLOBSTAR) ? '**' : (''+p) - }).join('/') -} - -Glob.prototype._stat = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } - - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterStat(f, abs, cb, er) - } - - this.log('stat', [this.cwd, f, '=', abs]) - - if (!this.stat && this.cache.hasOwnProperty(f)) { - var exists = this.cache[f] - , isDir = exists && (Array.isArray(exists) || exists === 2) - if (this.sync) return cb.call(this, !!exists, isDir) - return process.nextTick(cb.bind(this, !!exists, isDir)) - } - - var stat = this.statCache[abs] - if (this.sync || stat) { - var er - try { - stat = fs.statSync(abs) - } catch (e) { - er = e - } - this._afterStat(f, abs, cb, er, stat) - } else { - fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) - } -} - -Glob.prototype._afterStat = function (f, abs, cb, er, stat) { - var exists - assert(this instanceof Glob) - - if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { - this.log("should be ENOTDIR, fake it") - - er = new Error("ENOTDIR, not a directory '" + abs + "'") - er.path = abs - er.code = "ENOTDIR" - stat = null - } - - var emit = !this.statCache[abs] - this.statCache[abs] = stat - - if (er || !stat) { - exists = false - } else { - exists = stat.isDirectory() ? 2 : 1 - if (emit) - this.emit('stat', f, stat) - } - this.cache[f] = this.cache[f] || exists - cb.call(this, !!exists, exists === 2) -} - -Glob.prototype._readdir = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (isAbsolute(f)) { - abs = f - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } - - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterReaddir(f, abs, cb, er) - } - - this.log('readdir', [this.cwd, f, abs]) - if (this.cache.hasOwnProperty(f)) { - var c = this.cache[f] - if (Array.isArray(c)) { - if (this.sync) return cb.call(this, null, c) - return process.nextTick(cb.bind(this, null, c)) - } - - if (!c || c === 1) { - // either ENOENT or ENOTDIR - var code = c ? "ENOTDIR" : "ENOENT" - , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) - er.path = f - er.code = code - this.log(f, er) - if (this.sync) return cb.call(this, er) - return process.nextTick(cb.bind(this, er)) - } - - // at this point, c === 2, meaning it's a dir, but we haven't - // had to read it yet, or c === true, meaning it's *something* - // but we don't have any idea what. Need to read it, either way. - } - - if (this.sync) { - var er, entries - try { - entries = fs.readdirSync(abs) - } catch (e) { - er = e - } - return this._afterReaddir(f, abs, cb, er, entries) - } - - fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) -} - -Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { - assert(this instanceof Glob) - if (entries && !er) { - this.cache[f] = entries - // if we haven't asked to stat everything for suresies, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. This also gets us one step - // further into ELOOP territory. - if (!this.mark && !this.stat) { - entries.forEach(function (e) { - if (f === "/") e = f + e - else e = f + "/" + e - this.cache[e] = true - }, this) - } - - return cb.call(this, er, entries) - } - - // now handle errors, and cache the information - if (er) switch (er.code) { - case "ENOTDIR": // totally normal. means it *does* exist. - this.cache[f] = 1 - return cb.call(this, er) - case "ENOENT": // not terribly unusual - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.cache[f] = false - return cb.call(this, er) - default: // some unusual error. Treat as failure. - this.cache[f] = false - if (this.strict) this.emit("error", er) - if (!this.silent) console.error("glob error", er) - return cb.call(this, er) - } -} - -var isAbsolute = process.platform === "win32" ? absWin : absUnix - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - , result = splitDeviceRe.exec(p) - , device = result[1] || '' - , isUnc = device && device.charAt(1) !== ':' - , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over [fs module](http://api.nodejs.org/fs.html) - -graceful-fs: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## USAGE - -```javascript -// use just like fs -var fs = require('graceful-fs') - -// now go and do stuff with it... -fs.readFileSync('some-file-or-whatever') -``` diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/fs.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/fs.js deleted file mode 100644 index ae9fd6f..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/fs.js +++ /dev/null @@ -1,11 +0,0 @@ -// eeeeeevvvvviiiiiiillllll -// more evil than monkey-patching the native builtin? -// Not sure. - -var mod = require("module") -var pre = '(function (exports, require, module, __filename, __dirname) { ' -var post = '});' -var src = pre + process.binding('natives').fs + post -var vm = require('vm') -var fn = vm.runInThisContext(src) -return fn(exports, require, module, __filename, __dirname) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 77fc702..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,158 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('./fs.js') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -var util = require('util') - -function noop () {} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - if (files && files.sort) - files = files.sort() - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index 774ded1..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "A drop-in replacement for fs, making various improvements.", - "version": "3.0.4", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "BSD", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^0.4.13" - }, - "gitHead": "d3fd03247ccc4fa8a3eee399307fd266c70efb06", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "homepage": "https://github.com/isaacs/node-graceful-fs", - "_id": "graceful-fs@3.0.4", - "_shasum": "a0306d9b0940e0fc512d33b5df1014e88e0637a3", - "_from": "graceful-fs@>=3.0.2 <4.0.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "a0306d9b0940e0fc512d33b5df1014e88e0637a3", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz" - }, - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/polyfills.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 9d62af5..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,255 +0,0 @@ -var fs = require('./fs.js') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. -// It should not fail on enosys ever, as this just indicates -// that a fs doesn't support the intended operation. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chmod = chownFix(fs.chmod) -fs.fchmod = chownFix(fs.fchmod) -fs.lchmod = chownFix(fs.lchmod) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -fs.chmodSync = chownFix(fs.chmodSync) -fs.fchmodSync = chownFix(fs.fchmodSync) -fs.lchmodSync = chownFix(fs.lchmodSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -// ENOSYS means that the fs doesn't support the op. Just ignore -// that, because it doesn't matter. -// -// if there's no getuid, or if getuid() is something other -// than 0, and the error is EINVAL or EPERM, then just ignore -// it. -// -// This specific case is a silent failure in cp, install, tar, -// and most other unix tools that manage permissions. -// -// When running as root, or if other types of errors are -// encountered, then it's strict. -function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} - diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/max-open.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index 44d5267..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/max-open.js +++ /dev/null @@ -1,69 +0,0 @@ -var test = require('tap').test -var fs = require('../') - -test('open lots of stuff', function (t) { - // Get around EBADF from libuv by making sure that stderr is opened - // Otherwise Darwin will refuse to give us a FD for stderr! - process.stderr.write('') - - // How many parallel open()'s to do - var n = 1024 - var opens = 0 - var fds = [] - var going = true - var closing = false - var doneCalled = 0 - - for (var i = 0; i < n; i++) { - go() - } - - function go() { - opens++ - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fds.push(fd) - if (going) go() - }) - } - - // should hit ulimit pretty fast - setTimeout(function () { - going = false - t.equal(opens - fds.length, n) - done() - }, 100) - - - function done () { - if (closing) return - doneCalled++ - - if (fds.length === 0) { - //console.error('done called %d times', doneCalled) - // First because of the timeout - // Then to close the fd's opened afterwards - // Then this time, to complete. - // Might take multiple passes, depending on CPU speed - // and ulimit, but at least 3 in every case. - t.ok(doneCalled >= 3) - return t.end() - } - - closing = true - setTimeout(function () { - // console.error('do closing again') - closing = false - done() - }, 100) - - // console.error('closing time') - var closes = fds.slice(0) - fds.length = 0 - closes.forEach(function (fd) { - fs.close(fd, function (er) { - if (er) throw er - }) - }) - } -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f2..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('../fs.js')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.end() - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/readdir-sort.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a68..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/readdir-sort.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require("tap").test -var fs = require("../fs.js") - -var readdir = fs.readdir -fs.readdir = function(path, cb) { - process.nextTick(function() { - cb(null, ["b", "z", "a"]) - }) -} - -var g = require("../") - -test("readdir reorder", function (t) { - g.readdir("whatevers", function (er, files) { - if (er) - throw er - t.same(files, [ "a", "b", "z" ]) - t.end() - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/write-then-read.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 3a3db54..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/write-then-read.js +++ /dev/null @@ -1,45 +0,0 @@ -var fs = require('../'); -var rimraf = require('rimraf'); -var mkdirp = require('mkdirp'); -var test = require('tap').test; -var p = require('path').resolve(__dirname, 'files'); - -// Make sure to reserve the stderr fd -process.stderr.write(''); - -var num = 4097; -var paths = new Array(num); - -test('make files', function (t) { - rimraf.sync(p); - mkdirp.sync(p); - - for (var i = 0; i < num; ++i) { - paths[i] = 'files/file-' + i; - fs.writeFileSync(paths[i], 'content'); - } - - t.end(); -}) - -test('read files', function (t) { - // now read them - var done = 0; - for (var i = 0; i < num; ++i) { - fs.readFile(paths[i], function(err, data) { - if (err) - throw err; - - ++done; - if (done === num) { - t.pass('success'); - t.end() - } - }); - } -}); - -test('cleanup', function (t) { - rimraf.sync(p); - t.end(); -}); diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a7..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index ca12ef3..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.1", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits" - }, - "license": "ISC", - "scripts": { - "test": "node test" - }, - "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "homepage": "https://github.com/isaacs/inherits", - "_id": "inherits@2.0.1", - "_from": "inherits@>=2.0.0 <3.0.0" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js deleted file mode 100644 index fc53012..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/.npmignore b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/.travis.yml b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/.travis.yml deleted file mode 100644 index fca8ef0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.10 - - 0.11 diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index 5b3967e..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -Eventually, it will replace the C binding in node-glob. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 4761786..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1073 +0,0 @@ -;(function (require, exports, module, platform) { - -if (module) module.exports = minimatch -else exports.minimatch = minimatch - -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} - -minimatch.Minimatch = Minimatch - -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") - -var path = require("path") - // any single thing other than / - // don't need to escape / when using new RegExp() - , qmark = "[^/]" - - // * => any number of characters - , star = qmark + "*?" - - // ** when dots are allowed. Anything goes, except .. and . - // not (^ or / followed by one or two dots followed by $ or /), - // followed by anything, any number of times. - , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" - - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" - - // characters that need to be escaped in RegExp. - , reSpecials = charSet("().*{}+?[]^$\\!") - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split("").reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - - -function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - return false - } - - // "" only matches "" - if (pattern.trim() === "") return p === "" - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) - } - - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - pattern = pattern.split("\\").join("/") - } - - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function() {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - , negate = false - , options = this.options - , negateOffset = 0 - - if (options.nonegate) return - - for ( var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === "!" - ; i ++) { - negate = !negate - negateOffset ++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() -} - -Minimatch.prototype.braceExpand = braceExpand - -function pad(n, width, z) { - z = z || '0'; - n = n + ''; - return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -} - -function braceExpand (pattern, options) { - options = options || this.options - pattern = typeof pattern === "undefined" - ? this.pattern : pattern - - if (typeof pattern === "undefined") { - throw new Error("undefined pattern") - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - this.debug(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - this.debug("no sets") - return [pattern] - } - - var tail = braceExpand.call(this, pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - this.debug("numset", numset[1], numset[2]) - var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) - , start = +numset[1] - , needPadding = numset[1][0] === '0' - , startWidth = numset[1].length - , padded - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - - for (var i = start; i != (end + inc); i += inc) { - padded = needPadding ? pad(i, startWidth) : i + '' - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(padded + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - this.debug("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - this.debug("didn't close", pattern) - return braceExpand.call(this, "\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - this.debug("set", set) - this.debug("suffix", pattern.substr(i)) - var suf = braceExpand.call(this, pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - this.debug("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand.call(this, p, options) - }, this) - this.debug("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === "**") return GLOBSTAR - if (pattern === "") return "" - - var re = "" - , hasMagic = !!options.nocase - , escaping = false - // ? => one single character - , patternListStack = [] - , plType - , stateChar - , inClass = false - , reClassStart = -1 - , classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - , patternStart = pattern.charAt(0) === "." ? "" // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" - : "(?!\\.)" - , self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case "*": - re += star - hasMagic = true - break - case "?": - re += qmark - hasMagic = true - break - default: - re += "\\"+stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - this.debug("%s\t%s %s %j", pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += "\\" + c - escaping = false - continue - } - - SWITCH: switch (c) { - case "/": - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case "\\": - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === "!" && i === classStart + 1) c = "^" - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case "(": - if (inClass) { - re += "(" - continue - } - - if (!stateChar) { - re += "\\(" - continue - } - - plType = stateChar - patternListStack.push({ type: plType - , start: i - 1 - , reStart: re.length }) - // negation is (?:(?!js)[^/]*) - re += stateChar === "!" ? "(?:(?!" : "(?:" - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - clearStateChar() - hasMagic = true - re += ")" - plType = patternListStack.pop().type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case "!": - re += "[^/]*?)" - break - case "?": - case "+": - case "*": re += plType - case "@": break // the default anyway - } - continue - - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|" - escaping = false - continue - } - - clearStateChar() - re += "|" - continue - - // these are mostly the same in regexp and glob - case "[": - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += "\\" + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case "]": - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += "\\" + c - escaping = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === "^" && inClass)) { - re += "\\" - } - - re += c - - } // switch - } // for - - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - var cs = pattern.substr(classStart + 1) - , sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + "\\[" + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - var pl - while (pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = "\\" - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + "|" - }) - - this.debug("tail=%j\n %s", tail, tail) - var t = pl.type === "*" ? star - : pl.type === "?" ? qmark - : "\\" + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) - + t + "\\(" - + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += "\\\\" - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case ".": - case "[": - case "(": addPatternStart = true - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== "" && hasMagic) re = "(?=.)" + re - - if (addPatternStart) re = patternStart + re - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [ re, hasMagic ] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? "i" : "" - , regExp = new RegExp("^" + re + "$", flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) return this.regexp = false - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - , flags = options.nocase ? "i" : "" - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === "string") ? regExpEscape(p) - : p._src - }).join("\\\/") - }).join("|") - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = "^(?:" + re + ")$" - - // can match anything, as long as it's not this. - if (this.negate) re = "^(?!" + re + ").*$" - - try { - return this.regexp = new RegExp(re, flags) - } catch (ex) { - return this.regexp = false - } -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug("match", f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === "" - - if (f === "/" && partial) return true - - var options = this.options - - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - f = f.split("\\").join("/") - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, "split", f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, "set", set) - - // Find the basename of the path by looking for the last non-empty segment - var filename; - for (var i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i], file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug("matchOne", - { "this": this - , file: file - , pattern: pattern }) - - this.debug("matchOne", file.length, pattern.length) - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - this.debug("matchOne loop") - var p = pattern[pi] - , f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - , pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for ( ; fi < fl; fi ++) { - if (file[fi] === "." || file[fi] === ".." || - (!options.dot && file[fi].charAt(0) === ".")) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - WHILE: while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', - file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === "." || swallowee === ".." || - (!options.dot && swallowee.charAt(0) === ".")) { - this.debug("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr ++ - } - } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug("\n>>> no match, partial?", file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === "string") { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug("string match", p, f, hit) - } else { - hit = f.match(p) - this.debug("pattern match", p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") - return emptyFileEnd - } - - // should be unreachable. - throw new Error("wtf?") -} - - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, "$1") -} - - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") -} - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS deleted file mode 100644 index 4a0bc50..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +++ /dev/null @@ -1,14 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Brian Cottingham -Carlos Brito Lage -Jesse Dailey -Kevin O'Hara -Marco Rogers -Mark Cavage -Marko Mikulicic -Nathan Rajlich -Satheesh Natesan -Trent Mick -ashleybrener -n4kz diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `n` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index d1d1381..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,252 +0,0 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function naiveLength () { return 1 } - -function LRUCache (options) { - if (!(this instanceof LRUCache)) - return new LRUCache(options) - - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - this._max = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) - this._max = Infinity - - this._lengthCalculator = options.length || naiveLength - if (typeof this._lengthCalculator !== "function") - this._lengthCalculator = naiveLength - - this._allowStale = options.stale || false - this._maxAge = options.maxAge || null - this._dispose = options.dispose - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - this._max = mL - if (this._length > this._max) trim(this) - } - , get : function () { return this._max } - , enumerable : true - }) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - this._lengthCalculator = naiveLength - this._length = this._itemCount - for (var key in this._cache) { - this._cache[key].length = 1 - } - } else { - this._lengthCalculator = lC - this._length = 0 - for (var key in this._cache) { - this._cache[key].length = this._lengthCalculator(this._cache[key].value) - this._length += this._cache[key].length - } - } - - if (this._length > this._max) trim(this) - } - , get : function () { return this._lengthCalculator } - , enumerable : true - }) - -Object.defineProperty(LRUCache.prototype, "length", - { get : function () { return this._length } - , enumerable : true - }) - - -Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } - , enumerable : true - }) - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - i++ - var hit = this._lruList[k] - if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { - del(this, hit) - if (!this._allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } -} - -LRUCache.prototype.keys = function () { - var keys = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - keys[i++] = hit.key - } - return keys -} - -LRUCache.prototype.values = function () { - var values = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - values[i++] = hit.value - } - return values -} - -LRUCache.prototype.reset = function () { - if (this._dispose && this._cache) { - for (var k in this._cache) { - this._dispose(k, this._cache[k].value) - } - } - - this._cache = Object.create(null) // hash of items by key - this._lruList = Object.create(null) // list of items in order of use recency - this._mru = 0 // most recently used - this._lru = 0 // least recently used - this._length = 0 // number of items in the list - this._itemCount = 0 -} - -// Provided for debugging/dev purposes only. No promises whatsoever that -// this API stays stable. -LRUCache.prototype.dump = function () { - return this._cache -} - -LRUCache.prototype.dumpLru = function () { - return this._lruList -} - -LRUCache.prototype.set = function (key, value) { - if (hOP(this._cache, key)) { - // dispose of the old one before overwriting - if (this._dispose) this._dispose(key, this._cache[key].value) - if (this._maxAge) this._cache[key].now = Date.now() - this._cache[key].value = value - this.get(key) - return true - } - - var len = this._lengthCalculator(value) - var age = this._maxAge ? Date.now() : 0 - var hit = new Entry(key, value, this._mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > this._max) { - if (this._dispose) this._dispose(key, value) - return false - } - - this._length += hit.length - this._lruList[hit.lu] = this._cache[key] = hit - this._itemCount ++ - - if (this._length > this._max) trim(this) - return true -} - -LRUCache.prototype.has = function (key) { - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] - if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var hit = this._lruList[this._lru] - del(this, hit) - return hit || null -} - -LRUCache.prototype.del = function (key) { - del(this, this._cache[key]) -} - -function get (self, key, doUse) { - var hit = self._cache[key] - if (hit) { - if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { - del(self, hit) - if (!self._allowStale) hit = undefined - } else { - if (doUse) use(self, hit) - } - if (hit) hit = hit.value - } - return hit -} - -function use (self, hit) { - shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit -} - -function trim (self) { - while (self._lru < self._mru && self._length > self._max) - del(self, self._lruList[self._lru]) -} - -function shiftLU (self, hit) { - delete self._lruList[ hit.lu ] - while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ -} - -function del (self, hit) { - if (hit) { - if (self._dispose) self._dispose(hit.key, hit.value) - self._length -= hit.length - self._itemCount -- - delete self._cache[ hit.key ] - shiftLU(self, hit) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, lu, length, now) { - this.key = key - this.value = value - this.lu = lu - this.length = length - this.now = now -} - -})() diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 0acc7b8..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.5.0", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "scripts": { - "test": "tap test --gc" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "", - "weak": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" - }, - "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "homepage": "https://github.com/isaacs/node-lru-cache", - "_id": "lru-cache@2.5.0", - "_from": "lru-cache@>=2.0.0 <3.0.0" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index f72697c..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,369 +0,0 @@ -var test = require("tap").test - , LRU = require("../") - -test("basic", function (t) { - var cache = new LRU({max: 10}) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.max, 10) - t.end() -}) - -test("least recently set", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test("del", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("max", function (t) { - var cache = new LRU(3) - - // test changing the max, verify that the LRU items get dropped. - cache.max = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the max restriction, and try again. - cache.max = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test("reset", function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.max, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - - -// Note: `.dump()` is a debugging tool only. No guarantees are made -// about the format/layout of the response. -test("dump", function (t) { - var cache = new LRU(10) - var d = cache.dump(); - t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") - cache.set("a", "A") - var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } - t.ok(d.a) - t.equal(d.a.key, "a") - t.equal(d.a.value, "A") - t.equal(d.a.lu, 0) - - cache.set("b", "B") - cache.get("b") - d = cache.dump() - t.ok(d.b) - t.equal(d.b.key, "b") - t.equal(d.b.value, "B") - t.equal(d.b.lu, 2) - - t.end() -}) - - -test("basic with weighed length", function (t) { - var cache = new LRU({ - max: 100, - length: function (item) { return item.size } - }) - cache.set("key", {val: "value", size: 50}) - t.equal(cache.get("key").val, "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.lengthCalculator(cache.get("key")), 50) - t.equal(cache.length, 50) - t.equal(cache.max, 100) - t.end() -}) - - -test("weighed length item too large", function (t) { - var cache = new LRU({ - max: 10, - length: function (item) { return item.size } - }) - t.equal(cache.max, 10) - - // should fall out immediately - cache.set("key", {val: "value", size: 50}) - - t.equal(cache.length, 0) - t.equal(cache.get("key"), undefined) - t.end() -}) - -test("least recently set with weighed length", function (t) { - var cache = new LRU({ - max:8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.set("d", "DDDD") - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("c"), "CCC") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.get("a") - cache.get("b") - cache.set("d", "DDDD") - t.equal(cache.get("c"), undefined) - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("b"), "BB") - t.equal(cache.get("a"), "A") - t.end() -}) - -test("set returns proper booleans", function(t) { - var cache = new LRU({ - max: 5, - length: function (item) { return item.length } - }) - - t.equal(cache.set("a", "A"), true) - - // should return false for max exceeded - t.equal(cache.set("b", "donuts"), false) - - t.equal(cache.set("b", "B"), true) - t.equal(cache.set("c", "CCCC"), true) - t.end() -}) - -test("drop the old items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A") - - setTimeout(function () { - cache.set("b", "b") - t.equal(cache.get("a"), "A") - }, 25) - - setTimeout(function () { - cache.set("c", "C") - // timed out - t.notOk(cache.get("a")) - }, 60) - - setTimeout(function () { - t.notOk(cache.get("b")) - t.equal(cache.get("c"), "C") - }, 90) - - setTimeout(function () { - t.notOk(cache.get("c")) - t.end() - }, 155) -}) - -test("disposal function", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - dispose: function (k, n) { - disposed = n - } - }) - - cache.set(1, 1) - cache.set(2, 2) - t.equal(disposed, 1) - cache.set(3, 3) - t.equal(disposed, 2) - cache.reset() - t.equal(disposed, 3) - t.end() -}) - -test("disposal function on too big of item", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - length: function (k) { - return k.length - }, - dispose: function (k, n) { - disposed = n - } - }) - var obj = [ 1, 2 ] - - t.equal(disposed, false) - cache.set("obj", obj) - t.equal(disposed, obj) - t.end() -}) - -test("has()", function(t) { - var cache = new LRU({ - max: 1, - maxAge: 10 - }) - - cache.set('foo', 'bar') - t.equal(cache.has('foo'), true) - cache.set('blu', 'baz') - t.equal(cache.has('foo'), false) - t.equal(cache.has('blu'), true) - setTimeout(function() { - t.equal(cache.has('blu'), false) - t.end() - }, 15) -}) - -test("stale", function(t) { - var cache = new LRU({ - maxAge: 10, - stale: true - }) - - cache.set('foo', 'bar') - t.equal(cache.get('foo'), 'bar') - t.equal(cache.has('foo'), true) - setTimeout(function() { - t.equal(cache.has('foo'), false) - t.equal(cache.get('foo'), 'bar') - t.equal(cache.get('foo'), undefined) - t.end() - }, 15) -}) - -test("lru update via set", function(t) { - var cache = LRU({ max: 2 }); - - cache.set('foo', 1); - cache.set('bar', 2); - cache.del('bar'); - cache.set('baz', 3); - cache.set('qux', 4); - - t.equal(cache.get('foo'), undefined) - t.equal(cache.get('bar'), undefined) - t.equal(cache.get('baz'), 3) - t.equal(cache.get('qux'), 4) - t.end() -}) - -test("least recently set w/ peek", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - t.equal(cache.peek("a"), "A") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("pop the least used item", function (t) { - var cache = new LRU(3) - , last - - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - - t.equal(cache.length, 3) - t.equal(cache.max, 3) - - // Ensure we pop a, c, b - cache.get("b", "B") - - last = cache.pop() - t.equal(last.key, "a") - t.equal(last.value, "A") - t.equal(cache.length, 2) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "c") - t.equal(last.value, "C") - t.equal(cache.length, 1) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "b") - t.equal(last.value, "B") - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last, null) - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('forEach', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 9 - l.forEach(function (val, key, cache) { - t.equal(cache, l) - t.equal(key, i.toString()) - t.equal(val, i.toString(2)) - i -= 1 - }) - - // get in order of most recently used - l.get(6) - l.get(8) - - var order = [ 8, 6, 9, 7, 5 ] - var i = 0 - - l.forEach(function (val, key, cache) { - var j = order[i ++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - - t.end() -}) - -test('keys() and values()', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - t.similar(l.keys(), ['9', '8', '7', '6', '5']) - t.similar(l.values(), ['1001', '1000', '111', '110', '101']) - - // get in order of most recently used - l.get(6) - l.get(8) - - t.similar(l.keys(), ['8', '6', '9', '7', '5']) - t.similar(l.values(), ['1000', '110', '1001', '111', '101']) - - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node --expose_gc - -var weak = require('weak'); -var test = require('tap').test -var LRU = require('../') -var l = new LRU({ max: 10 }) -var refs = 0 -function X() { - refs ++ - weak(this, deref) -} - -function deref() { - refs -- -} - -test('no leaks', function (t) { - // fill up the cache - for (var i = 0; i < 100; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var start = process.memoryUsage() - - // capture the memory - var startRefs = refs - - // do it again, but more - for (var i = 0; i < 10000; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var end = process.memoryUsage() - t.equal(refs, startRefs, 'no leaky refs') - - console.error('start: %j\n' + - 'end: %j', start, end); - t.pass(); - t.end(); -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached) - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocain-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `sys.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// different ways to id objects -// use a req/res pair, since it's crazy deep and cyclical - -// sparseFE10 and sigmund are usually pretty close, which is to be expected, -// since they are essentially the same algorithm, except that sigmund handles -// regular expression objects properly. - - -var http = require('http') -var util = require('util') -var sigmund = require('./sigmund.js') -var sreq, sres, creq, cres, test - -http.createServer(function (q, s) { - sreq = q - sres = s - sres.end('ok') - this.close(function () { setTimeout(function () { - start() - }, 200) }) -}).listen(1337, function () { - creq = http.get({ port: 1337 }) - creq.on('response', function (s) { cres = s }) -}) - -function start () { - test = [sreq, sres, creq, cres] - // test = sreq - // sreq.sres = sres - // sreq.creq = creq - // sreq.cres = cres - - for (var i in exports.compare) { - console.log(i) - var hash = exports.compare[i]() - console.log(hash) - console.log(hash.length) - console.log('') - } - - require('bench').runMain() -} - -function customWs (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return customWs(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + customWs(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function custom (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return '' + obj - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return custom(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + custom(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function sparseFE2 (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k + ':' - ch(v[k], depth + 1) - }) - soFar += '}' - } - ch(obj, 0) - return soFar -} - -function sparseFE (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k - ch(v[k], depth + 1) - }) - } - ch(obj, 0) - return soFar -} - -function sparse (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k - ch(v[k], depth + 1) - } - } - ch(obj, 0) - return soFar -} - -function noCommas (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - - -function flatten (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - soFar += ',' - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - -exports.compare = -{ - // 'custom 2': function () { - // return custom(test, 2, 0) - // }, - // 'customWs 2': function () { - // return customWs(test, 2, 0) - // }, - 'JSON.stringify (guarded)': function () { - var seen = [] - return JSON.stringify(test, function (k, v) { - if (typeof v !== 'object' || !v) return v - if (seen.indexOf(v) !== -1) return undefined - seen.push(v) - return v - }) - }, - - 'flatten 10': function () { - return flatten(test, 10) - }, - - // 'flattenFE 10': function () { - // return flattenFE(test, 10) - // }, - - 'noCommas 10': function () { - return noCommas(test, 10) - }, - - 'sparse 10': function () { - return sparse(test, 10) - }, - - 'sparseFE 10': function () { - return sparseFE(test, 10) - }, - - 'sparseFE2 10': function () { - return sparseFE2(test, 10) - }, - - sigmund: function() { - return sigmund(test, 10) - }, - - - // 'util.inspect 1': function () { - // return util.inspect(test, false, 1, false) - // }, - // 'util.inspect undefined': function () { - // util.inspect(test) - // }, - // 'util.inspect 2': function () { - // util.inspect(test, false, 2, false) - // }, - // 'util.inspect 3': function () { - // util.inspect(test, false, 3, false) - // }, - // 'util.inspect 4': function () { - // util.inspect(test, false, 4, false) - // }, - // 'util.inspect Infinity': function () { - // util.inspect(test, false, Infinity, false) - // } -} - -/** results -**/ diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index 94b6453..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "sigmund", - "version": "1.0.0", - "description": "Quick and dirty signatures for Objects.", - "main": "sigmund.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js", - "bench": "node bench.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund" - }, - "keywords": [ - "object", - "signature", - "key", - "data", - "psychoanalysis" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/sigmund/issues" - }, - "homepage": "https://github.com/isaacs/sigmund", - "_id": "sigmund@1.0.0", - "_from": "sigmund@>=1.0.0 <1.1.0" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = sigmund -function sigmund (subject, maxSessions) { - maxSessions = maxSessions || 10; - var notes = []; - var analysis = ''; - var RE = RegExp; - - function psychoAnalyze (subject, session) { - if (session > maxSessions) return; - - if (typeof subject === 'function' || - typeof subject === 'undefined') { - return; - } - - if (typeof subject !== 'object' || !subject || - (subject instanceof RE)) { - analysis += subject; - return; - } - - if (notes.indexOf(subject) !== -1 || session === maxSessions) return; - - notes.push(subject); - analysis += '{'; - Object.keys(subject).forEach(function (issue, _, __) { - // pseudo-private values. skip those. - if (issue.charAt(0) === '_') return; - var to = typeof subject[issue]; - if (to === 'function' || to === 'undefined') return; - analysis += issue; - psychoAnalyze(subject[issue], session + 1); - }); - } - psychoAnalyze(subject, 0); - return analysis; -} - -// vim: set softtabstop=4 shiftwidth=4: diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test -var sigmund = require('../sigmund.js') - - -// occasionally there are duplicates -// that's an acceptable edge-case. JSON.stringify and util.inspect -// have some collision potential as well, though less, and collision -// detection is expensive. -var hash = '{abc/def/g{0h1i2{jkl' -var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} -var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -var obj3 = JSON.parse(JSON.stringify(obj1)) -obj3.c = /def/ -obj3.g[2].cycle = obj3 -var cycleHash = '{abc/def/g{0h1i2{jklcycle' - -test('basic', function (t) { - t.equal(sigmund(obj1), hash) - t.equal(sigmund(obj2), hash) - t.equal(sigmund(obj3), cycleHash) - t.end() -}) - diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index 8bf46cc..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "1.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test/*.js" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" - }, - "devDependencies": { - "tap": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, - "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "homepage": "https://github.com/isaacs/minimatch", - "_id": "minimatch@1.0.0", - "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "_from": "minimatch@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/basic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - - -var patterns = - [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - // https://github.com/isaacs/minimatch/issues/5 - , function () { - files = [ 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' - , 'a/b/.x' - , 'a/b/.x/' - , 'a/.x/b' - , '.x' - , '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b/.x/c' - , '.x/.x' ] - } - , ["**/.x/**", [ '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b' - , 'a/b/.x/' - , 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' ] ] - - ] - -var regexps = - [ '/^(?:(?=.)a[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:\\*)$/', - '/^(?:(?=.)\\*[^/]*?)$/', - '/^(?:\\*\\*)$/', - '/^(?:(?=.)b[^/]*?\\/)$/', - '/^(?:(?=.)c[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', - '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', - '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', - '/^(?:(?=.)a[^/]*?[^c])$/', - '/^(?:(?=.)a[X-]b)$/', - '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', - '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[^/]c)$/', - '/^(?:a\\*c)$/', - 'false', - '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', - '/^(?:man\\/man1\\/bash\\.1)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[-abc])$/', - '/^(?:(?!\\.)(?=.)[abc-])$/', - '/^(?:\\\\)$/', - '/^(?:(?!\\.)(?=.)[\\\\])$/', - '/^(?:(?!\\.)(?=.)[\\[])$/', - '/^(?:\\[)$/', - '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[\\]])$/', - '/^(?:(?!\\.)(?=.)[\\]-])$/', - '/^(?:(?!\\.)(?=.)[a-z])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:\\[\\])$/', - '/^(?:\\[abc)$/', - '/^(?:(?=.)XYZ)$/i', - '/^(?:(?=.)ab[^/]*?)$/i', - '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', - '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', - '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', - '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', - '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', - '/^(?:(?=.)a[^/]b)$/', - '/^(?:(?=.)#[^/]*?)$/', - '/^(?!^(?:(?=.)a[^/]*?)$).*$/', - '/^(?:(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)a[^/]*?)$/', - '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] -var re = 0; - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - patterns.forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var m = new mm.Minimatch(pattern, options) - var r = m.makeRe() - var expectRe = regexps[re++] - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - - t.equal(tapOpts.re, expectRe, tapOpts) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/brace-expand.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index e63d3f6..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,40 +0,0 @@ -var tap = require("tap") - , minimatch = require("../") - -tap.test("brace expansion", function (t) { - // [ pattern, [expanded] ] - ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" - , [ "abxy" - , "abxz" - , "acdxy" - , "acdxz" - , "acexy" - , "acexz" - , "afhxy" - , "afhxz" - , "aghxy" - , "aghxz" ] ] - , [ "a{1..5}b" - , [ "a1b" - , "a2b" - , "a3b" - , "a4b" - , "a5b" ] ] - , [ "a{b}c", ["a{b}c"] ] - , [ "a{00..05}b" - , ["a00b" - ,"a01b" - ,"a02b" - ,"a03b" - ,"a04b" - ,"a05b" ] ] - ].forEach(function (tc) { - var p = tc[0] - , expect = tc[1] - t.equivalent(minimatch.braceExpand(p), expect, p) - }) - console.error("ending") - t.end() -}) - - diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/caching.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -var Minimatch = require("../minimatch.js").Minimatch -var tap = require("tap") -tap.test("cache test", function (t) { - var mm1 = new Minimatch("a?b") - var mm2 = new Minimatch("a?b") - t.equal(mm1, mm2, "should get the same object") - // the lru should drop it after 100 entries - for (var i = 0; i < 100; i ++) { - new Minimatch("a"+i) - } - mm2 = new Minimatch("a?b") - t.notEqual(mm1, mm2, "cache should have dropped") - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/defaults.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 75e0571..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - ; [ "http://www.bashcookbook.com/bashinfo" + - "/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - ].forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var Class = mm.defaults(options).Minimatch - var m = new Class(pattern, {}) - var r = m.makeRe() - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js deleted file mode 100644 index 6676e26..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +++ /dev/null @@ -1,8 +0,0 @@ -var test = require('tap').test -var minimatch = require('../') - -test('extglob ending with statechar', function(t) { - t.notOk(minimatch('ax', 'a?(b*)')) - t.ok(minimatch('ax', '?(a*|b)')) - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/README.md deleted file mode 100644 index a2981ea..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/README.md deleted file mode 100644 index 98eab25..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/package.json deleted file mode 100644 index 6fc1c08..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.1", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^0.4.12" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/wrappy" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy", - "gitHead": "006a8cbac6b99988315834c207896eed71fd069a", - "_id": "wrappy@1.0.1", - "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", - "_from": "wrappy@>=1.0.0 <2.0.0", - "_npmVersion": "2.0.0", - "_nodeVersion": "0.10.31", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", - "tarball": "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - }, - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js deleted file mode 100644 index 5ed0fcd..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +++ /dev/null @@ -1,51 +0,0 @@ -var test = require('tap').test -var wrappy = require('../wrappy.js') - -test('basic', function (t) { - function onceifier (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } - } - onceifier.iAmOnce = {} - var once = wrappy(onceifier) - t.equal(once.iAmOnce, onceifier.iAmOnce) - - var called = 0 - function boo () { - t.equal(called, 0) - called++ - } - // has some rando property - boo.iAmBoo = true - - var onlyPrintOnce = once(boo) - - onlyPrintOnce() // prints 'boo' - onlyPrintOnce() // does nothing - t.equal(called, 1) - - // random property is retained! - t.equal(onlyPrintOnce.iAmBoo, true) - - var logs = [] - var logwrap = wrappy(function (msg, cb) { - logs.push(msg + ' wrapping cb') - return function () { - logs.push(msg + ' before cb') - var ret = cb.apply(this, arguments) - logs.push(msg + ' after cb') - } - }) - - var c = logwrap('foo', function () { - t.same(logs, [ 'foo wrapping cb', 'foo before cb' ]) - }) - c() - t.same(logs, [ 'foo wrapping cb', 'foo before cb', 'foo after cb' ]) - - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/once.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/once.js deleted file mode 100644 index 2e1e721..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/once.js +++ /dev/null @@ -1,21 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/package.json deleted file mode 100644 index 36eb735..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "once", - "version": "1.3.1", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "gitHead": "c90ac02a74f433ce47f6938869e68dd6196ffc2c", - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "homepage": "https://github.com/isaacs/once", - "_id": "once@1.3.1", - "_shasum": "f3f3e4da5b7d27b5c732969ee3e67e729457b31f", - "_from": "once@>=1.3.0 <2.0.0", - "_npmVersion": "2.0.0", - "_nodeVersion": "0.10.31", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "f3f3e4da5b7d27b5c732969ee3e67e729457b31f", - "tarball": "http://registry.npmjs.org/once/-/once-1.3.1.tgz" - }, - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/test/once.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/test/once.js deleted file mode 100644 index c618360..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/once/test/once.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tap').test -var once = require('../once.js') - -test('once', function (t) { - var f = 0 - function fn (g) { - t.equal(f, 0) - f ++ - return f + g + this - } - fn.ownProperty = {} - var foo = once(fn) - t.equal(fn.ownProperty, foo.ownProperty) - t.notOk(foo.called) - for (var i = 0; i < 1E3; i++) { - t.same(f, i === 0 ? 0 : 1) - var g = foo.call(1, 1) - t.ok(foo.called) - t.same(g, 3) - t.same(f, 1) - } - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/oh-my-glob.gif b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/oh-my-glob.gif deleted file mode 100644 index a1568c1..0000000 Binary files a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/oh-my-glob.gif and /dev/null differ diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/package.json deleted file mode 100644 index abdf815..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "4.0.6", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "engines": { - "node": "*" - }, - "dependencies": { - "graceful-fs": "^3.0.2", - "inherits": "2", - "minimatch": "^1.0.0", - "once": "^1.3.0" - }, - "devDependencies": { - "tap": "~0.4.0", - "mkdirp": "0", - "rimraf": "1" - }, - "scripts": { - "test": "tap test/*.js", - "test-regen": "TEST_REGEN=1 node test/00-setup.js" - }, - "license": "ISC", - "gitHead": "6825c425e738eaffa315d8cdb1a4c3255ededcb3", - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@4.0.6", - "_shasum": "695c50bdd4e2fb5c5d370b091f388d3707e291a7", - "_from": "glob@>=3.1.4", - "_npmVersion": "2.0.0", - "_nodeVersion": "0.10.31", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "695c50bdd4e2fb5c5d370b091f388d3707e291a7", - "tarball": "http://registry.npmjs.org/glob/-/glob-4.0.6.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afaf..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// just a little pre-run script to set up the fixtures. -// zz-finish cleans it up - -var mkdirp = require("mkdirp") -var path = require("path") -var i = 0 -var tap = require("tap") -var fs = require("fs") -var rimraf = require("rimraf") - -var files = -[ "a/.abcdef/x/y/z/a" -, "a/abcdef/g/h" -, "a/abcfed/g/h" -, "a/b/c/d" -, "a/bc/e/f" -, "a/c/d/c/b" -, "a/cb/e/f" -] - -var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") -var symlinkFrom = "../.." - -files = files.map(function (f) { - return path.resolve(__dirname, f) -}) - -tap.test("remove fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "remove fixtures") - t.end() - }) -}) - -files.forEach(function (f) { - tap.test(f, function (t) { - var d = path.dirname(f) - mkdirp(d, 0755, function (er) { - if (er) { - t.fail(er) - return t.bailout() - } - fs.writeFile(f, "i like tests", function (er) { - t.ifError(er, "make file") - t.end() - }) - }) - }) -}) - -if (process.platform !== "win32") { - tap.test("symlinky", function (t) { - var d = path.dirname(symlinkTo) - console.error("mkdirp", d) - mkdirp(d, 0755, function (er) { - t.ifError(er) - fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { - t.ifError(er, "make symlink") - t.end() - }) - }) - }) -} - -;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { - w = "/tmp/glob-test/" + w - tap.test("create " + w, function (t) { - mkdirp(w, function (er) { - if (er) - throw er - t.pass(w) - t.end() - }) - }) -}) - - -// generate the bash pattern test-fixtures if possible -if (process.platform === "win32" || !process.env.TEST_REGEN) { - console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") - return -} - -var spawn = require("child_process").spawn; -var globs = - // put more patterns here. - // anything that would be directly in / should be in /tmp/glob-test - ["test/a/*/+(c|g)/./d" - ,"test/a/**/[cg]/../[cg]" - ,"test/a/{b,c,d,e,f}/**/g" - ,"test/a/b/**" - ,"test/**/g" - ,"test/a/abc{fed,def}/g/h" - ,"test/a/abc{fed/g,def}/**/" - ,"test/a/abc{fed/g,def}/**///**/" - ,"test/**/a/**/" - ,"test/+(a|b|c)/a{/,bc*}/**" - ,"test/*/*/*/f" - ,"test/**/f" - ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" - ,"{./*/*,/tmp/glob-test/*}" - ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! - ,"test/a/!(symlink)/**" - ] -var bashOutput = {} -var fs = require("fs") - -globs.forEach(function (pattern) { - tap.test("generate fixture " + pattern, function (t) { - var cmd = "shopt -s globstar && " + - "shopt -s extglob && " + - "shopt -s nullglob && " + - // "shopt >&2; " + - "eval \'for i in " + pattern + "; do echo $i; done\'" - var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) - var out = [] - cp.stdout.on("data", function (c) { - out.push(c) - }) - cp.stderr.pipe(process.stderr) - cp.on("close", function (code) { - out = flatten(out) - if (!out) - out = [] - else - out = cleanResults(out.split(/\r*\n/)) - - bashOutput[pattern] = out - t.notOk(code, "bash test should finish nicely") - t.end() - }) - }) -}) - -tap.test("save fixtures", function (t) { - var fname = path.resolve(__dirname, "bash-results.json") - var data = JSON.stringify(bashOutput, null, 2) + "\n" - fs.writeFile(fname, data, function (er) { - t.ifError(er) - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -function flatten (chunks) { - var s = 0 - chunks.forEach(function (c) { s += c.length }) - var out = new Buffer(s) - s = 0 - chunks.forEach(function (c) { - c.copy(out, s) - s += c.length - }) - - return out.toString().trim() -} - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// basic test -// show that it does the same thing by default as the shell. -var tap = require("tap") -, child_process = require("child_process") -, bashResults = require("./bash-results.json") -, globs = Object.keys(bashResults) -, glob = require("../") -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -globs.forEach(function (pattern) { - var expect = bashResults[pattern] - // anything regarding the symlink thing will fail on windows, so just skip it - if (process.platform === "win32" && - expect.some(function (m) { - return /\/symlink\//.test(m) - })) - return - - tap.test(pattern, function (t) { - glob(pattern, function (er, matches) { - if (er) - throw er - - // sort and unmark, just to match the shell results - matches = cleanResults(matches) - - t.deepEqual(matches, expect, pattern) - t.end() - }) - }) - - tap.test(pattern + " sync", function (t) { - var matches = cleanResults(glob.sync(pattern)) - - t.deepEqual(matches, expect, "should match shell") - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') - }) -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json deleted file mode 100644 index 8223d06..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,356 +0,0 @@ -{ - "test/a/*/+(c|g)/./d": [ - "test/a/b/c/./d" - ], - "test/a/**/[cg]/../[cg]": [ - "test/a/abcdef/g/../g", - "test/a/abcfed/g/../g", - "test/a/b/c/../c", - "test/a/c/../c", - "test/a/c/d/c/../c", - "test/a/symlink/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" - ], - "test/a/{b,c,d,e,f}/**/g": [], - "test/a/b/**": [ - "test/a/b", - "test/a/b/c", - "test/a/b/c/d" - ], - "test/**/g": [ - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed,def}/g/h": [ - "test/a/abcdef/g/h", - "test/a/abcfed/g/h" - ], - "test/a/abc{fed/g,def}/**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed/g,def}/**///**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/**/a/**/": [ - "test/a", - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/b", - "test/a/b/c", - "test/a/bc", - "test/a/bc/e", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/cb", - "test/a/cb/e", - "test/a/symlink", - "test/a/symlink/a", - "test/a/symlink/a/b", - "test/a/symlink/a/b/c", - "test/a/symlink/a/b/c/a", - "test/a/symlink/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" - ], - "test/+(a|b|c)/a{/,bc*}/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h" - ], - "test/*/*/*/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/**/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" - ], - "{./*/*,/tmp/glob-test/*}": [ - "./examples/g.js", - "./examples/usr-local.js", - "./node_modules/graceful-fs", - "./node_modules/inherits", - "./node_modules/minimatch", - "./node_modules/mkdirp", - "./node_modules/once", - "./node_modules/rimraf", - "./node_modules/tap", - "./test/00-setup.js", - "./test/a", - "./test/bash-comparison.js", - "./test/bash-results.json", - "./test/cwd-test.js", - "./test/empty-set.js", - "./test/error-callback.js", - "./test/globstar-match.js", - "./test/mark.js", - "./test/negation-test.js", - "./test/new-glob-optional-options.js", - "./test/nocase-nomagic.js", - "./test/pause-resume.js", - "./test/readme-issue.js", - "./test/root-nomount.js", - "./test/root.js", - "./test/stat.js", - "./test/zz-cleanup.js", - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq" - ], - "{/tmp/glob-test/*,*}": [ - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq", - "examples", - "glob.js", - "LICENSE", - "node_modules", - "package.json", - "README.md", - "test" - ], - "test/a/!(symlink)/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h", - "test/a/b", - "test/a/b/c", - "test/a/b/c/d", - "test/a/bc", - "test/a/bc/e", - "test/a/bc/e/f", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/c/d/c/b", - "test/a/cb", - "test/a/cb/e", - "test/a/cb/e/f" - ] -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27e..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing cwd and searching for **/d", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('**/d', function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('a', function (t) { - glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'b/c/d', 'c/d' ]) - t.end() - }) - }) - - t.test('a/b', function (t) { - glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('a/b/', function (t) { - glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('.', function (t) { - glob('**/d', {cwd: process.cwd()}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/empty-set.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/empty-set.js deleted file mode 100644 index 3b627b0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/empty-set.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tap').test -var glob = require("../glob.js") - -// Patterns that cannot match anything -var patterns = [ - '# comment', - ' ', - '\n', - 'just doesnt happen to match anything so this is a control' -] - -patterns.forEach(function (p) { - test(JSON.stringify(p), function (t) { - glob(p, function (e, f) { - t.equal(e, null, 'no error') - t.same(f, [], 'no returned values') - t.end() - }) - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/error-callback.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/error-callback.js deleted file mode 100644 index 60d3ba1..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/error-callback.js +++ /dev/null @@ -1,21 +0,0 @@ -var fs -try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } -var test = require('tap').test -var glob = require('../') - -test('mock fs', function(t) { - fs.readdir = function(path, cb) { - process.nextTick(function() { - cb(new Error('mock fs.readdir error')) - }) - } - t.pass('mocked') - t.end() -}) - -test('error callback', function(t) { - glob('*', function(err, res) { - t.ok(err, 'expecting mock error') - t.end() - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js deleted file mode 100644 index 9b234fa..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +++ /dev/null @@ -1,19 +0,0 @@ -var Glob = require("../glob.js").Glob -var test = require('tap').test - -test('globstar should not have dupe matches', function(t) { - var pattern = 'a/**/[gh]' - var g = new Glob(pattern, { cwd: __dirname }) - var matches = [] - g.on('match', function(m) { - console.error('match %j', m) - matches.push(m) - }) - g.on('end', function(set) { - console.error('set', set) - matches = matches.sort() - set = set.sort() - t.same(matches, set, 'should have same set of matches') - t.end() - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js deleted file mode 100644 index bf411c0..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +++ /dev/null @@ -1,118 +0,0 @@ -var test = require("tap").test -var glob = require('../') -process.chdir(__dirname) - -// expose timing issues -var lag = 5 -glob.Glob.prototype._stat = function(o) { return function(f, cb) { - var args = arguments - setTimeout(function() { - o.call(this, f, cb) - }.bind(this), lag += 5) -}}(glob.Glob.prototype._stat) - - -test("mark, with **", function (t) { - glob("a/*b*/**", {mark: true}, function (er, results) { - if (er) - throw er - var expect = - [ 'a/abcdef/', - 'a/abcdef/g/', - 'a/abcdef/g/h', - 'a/abcfed/', - 'a/abcfed/g/', - 'a/abcfed/g/h', - 'a/b/', - 'a/b/c/', - 'a/b/c/d', - 'a/bc/', - 'a/bc/e/', - 'a/bc/e/f', - 'a/cb/', - 'a/cb/e/', - 'a/cb/e/f' ] - - t.same(results, expect) - t.end() - }) -}) - -test("mark, no / on pattern", function (t) { - glob("a/*", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - - if (process.platform !== "win32") - expect.push('a/symlink/') - - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /\/$/) - }) -}) - -test("mark=false, no / on pattern", function (t) { - glob("a/*", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef', - 'a/abcfed', - 'a/b', - 'a/bc', - 'a/c', - 'a/cb' ] - - if (process.platform !== "win32") - expect.push('a/symlink') - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /[^\/]$/) - }) -}) - -test("mark=true, / on pattern", function (t) { - glob("a/*/", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /\/$/) - }) -}) - -test("mark=false, / on pattern", function (t) { - glob("a/*/", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /\/$/) - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/negation-test.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/negation-test.js deleted file mode 100644 index fc679e2..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/negation-test.js +++ /dev/null @@ -1,16 +0,0 @@ -// Negation test -// Show that glob respect's minimatch's negate flag - -var glob = require('../glob.js') -var test = require('tap').test - -test('glob respects minimatch negate flag when activated with leading !', function(t) { - var expect = ["abcdef/g", "abcfed/g", "c/d", "cb/e", "symlink/a"] - var results = glob("!b**/*", {cwd: 'a'}, function (er, results) { - if (er) - throw er - - t.same(results, expect) - t.end() - }); -}); diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js deleted file mode 100644 index 3e7dc5a..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js +++ /dev/null @@ -1,10 +0,0 @@ -var Glob = require('../glob.js').Glob; -var test = require('tap').test; - -test('new glob, with cb, and no options', function (t) { - new Glob(__filename, function(er, results) { - if (er) throw er; - t.same(results, [__filename]); - t.end(); - }); -}); diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index 5a29b08..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,125 +0,0 @@ -var fs -try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } -var test = require('tap').test; -var glob = require('../'); - -test('mock fs', function(t) { - var stat = fs.stat - var statSync = fs.statSync - var readdir = fs.readdir - var readdirSync = fs.readdirSync - - function fakeStat(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': - ret = { isDirectory: function() { return true } } - break - case '/tmp/a': case 'c:\\tmp\\a': - ret = { isDirectory: function() { return false } } - break - } - return ret - } - - fs.stat = function(path, cb) { - var f = fakeStat(path); - if (f) { - process.nextTick(function() { - cb(null, f) - }) - } else { - stat.call(fs, path, cb) - } - } - - fs.statSync = function(path) { - return fakeStat(path) || statSync.call(fs, path) - } - - function fakeReaddir(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': - ret = [ 'a', 'A' ] - break - case '/': case 'c:\\': - ret = ['tmp', 'tMp', 'tMP', 'TMP'] - } - return ret - } - - fs.readdir = function(path, cb) { - var f = fakeReaddir(path) - if (f) - process.nextTick(function() { - cb(null, f) - }) - else - readdir.call(fs, path, cb) - } - - fs.readdirSync = function(path) { - return fakeReaddir(path) || readdirSync.call(fs, path) - } - - t.pass('mocked') - t.end() -}) - -test('nocase, nomagic', function(t) { - var n = 2 - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - if(process.platform.match(/^win/)) { - want = want.map(function(p) { - return 'C:' + p - }) - } - glob('/tmp/a', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) - glob('/tmp/A', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) -}) - -test('nocase, with some magic', function(t) { - t.plan(2) - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - if(process.platform.match(/^win/)) { - want = want.map(function(p) { - return 'C:' + p - }) - } - - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// show that no match events happen while paused. -var tap = require("tap") -, child_process = require("child_process") -// just some gnarly pattern with lots of matches -, pattern = "test/a/!(symlink)/**" -, bashResults = require("./bash-results.json") -, patterns = Object.keys(bashResults) -, glob = require("../") -, Glob = glob.Glob -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -var globResults = [] -tap.test("use a Glob object, and pause/resume it", function (t) { - var g = new Glob(pattern) - , paused = false - , res = [] - , expect = bashResults[pattern] - - g.on("pause", function () { - console.error("pause") - }) - - g.on("resume", function () { - console.error("resume") - }) - - g.on("match", function (m) { - t.notOk(g.paused, "must not be paused") - globResults.push(m) - g.pause() - t.ok(g.paused, "must be paused") - setTimeout(g.resume.bind(g), 10) - }) - - g.on("end", function (matches) { - t.pass("reached glob end") - globResults = cleanResults(globResults) - matches = cleanResults(matches) - t.deepEqual(matches, globResults, - "end event matches should be the same as match events") - - t.deepEqual(matches, expect, - "glob matches should be the same as bash results") - - t.end() - }) -}) - diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js deleted file mode 100644 index 0b4e0be..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require("tap").test -var glob = require("../") - -var mkdirp = require("mkdirp") -var fs = require("fs") -var rimraf = require("rimraf") -var dir = __dirname + "/package" - -test("setup", function (t) { - mkdirp.sync(dir) - fs.writeFileSync(dir + "/package.json", "{}", "ascii") - fs.writeFileSync(dir + "/README", "x", "ascii") - t.pass("setup done") - t.end() -}) - -test("glob", function (t) { - var opt = { - cwd: dir, - nocase: true, - mark: true - } - - glob("README?(.*)", opt, function (er, files) { - if (er) - throw er - t.same(files, ["README"]) - t.end() - }) -}) - -test("cleanup", function (t) { - rimraf.sync(dir) - t.pass("clean") - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing root and searching for /b*/**", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) - }) - - t.test('a', function (t) { - glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f9..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -var t = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -var glob = require('../') -var path = require('path') - -t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) -}) - - -t.test('a', function (t) { - console.error("root=" + path.resolve('a')) - glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { - t.ifError(er) - var wanted = [ - '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' - ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - }) - - t.like(matches, wanted) - t.end() - }) -}) - -t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - })) - t.end() - }) -}) - -t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js deleted file mode 100644 index f555b39..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +++ /dev/null @@ -1,32 +0,0 @@ -var glob = require('../') -var test = require('tap').test -var path = require('path') - -test('stat all the things', function(t) { - var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) - var matches = [] - g.on('match', function(m) { - matches.push(m) - }) - var stats = [] - g.on('stat', function(m) { - stats.push(m) - }) - g.on('end', function(eof) { - stats = stats.sort() - matches = matches.sort() - eof = eof.sort() - t.same(stats, matches) - t.same(eof, matches) - var cache = Object.keys(this.statCache) - t.same(cache.map(function (f) { - return path.relative(__dirname, f).replace(/\\/g, '/') - }).sort(), matches) - - cache.forEach(function(c) { - t.equal(typeof this.statCache[c], 'object') - }, this) - - t.end() - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0f..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// remove the fixtures -var tap = require("tap") -, rimraf = require("rimraf") -, path = require("path") - -tap.test("cleanup fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "removed") - t.end() - }) -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/cli/package.json deleted file mode 100755 index beb70ad..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "cli", - "description": "A tool for rapidly building command line apps", - "version": "0.4.3", - "homepage": "http://github.com/chriso/cli", - "keywords": [ - "cli", - "command line", - "opts", - "parseopt", - "opt", - "args", - "console", - "argsparse", - "optparse", - "daemon", - "autocomplete", - "command", - "autocompletion" - ], - "author": { - "name": "Chris O'Hara", - "email": "cohara87@gmail.com" - }, - "main": "cli.js", - "bugs": { - "email": "cohara87@gmail.com", - "url": "http://github.com/chriso/cli/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/chriso/cli.git" - }, - "dependencies": { - "glob": ">= 3.1.4" - }, - "contributors": [ - { - "name": "Douglas Meyer" - } - ], - "engines": { - "node": ">=0.2.5" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "_npmUser": { - "name": "cohara87", - "email": "cohara87@gmail.com" - }, - "_id": "cli@0.4.3", - "devDependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.18", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "e6819c8d5faa957f64f98f66a8506268c1d1f17d", - "tarball": "http://registry.npmjs.org/cli/-/cli-0.4.3.tgz" - }, - "maintainers": [ - { - "name": "cohara87", - "email": "cohara87@gmail.com" - } - ], - "directories": {}, - "_shasum": "e6819c8d5faa957f64f98f66a8506268c1d1f17d", - "_from": "cli@0.4.3", - "_resolved": "https://registry.npmjs.org/cli/-/cli-0.4.3.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/.travis.yml b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/README.md deleted file mode 100644 index 2664c08..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -Eventually, it will replace the C binding in node-glob. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -``` - -## Features - -Supports all glob features. - -See: - -* `man sh` -* `man fnmatch` -* `man 5 gitignore` - -### Departures from zsh/bash/ksh/sh - -If the pattern starts with a `!` character, then it is negated. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. (Use `\#` to match a literal `#` at the -start of a line.) - -The double-star `**` is always supported, instead of requiring a special -flag. - -If an escaped pattern has no matches, and the `null` flag is not set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. - -## Functions - -### minimatch(path, pattern, options) - -Main export. Tests a path against -the pattern using the options. - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, then -return the pattern (unless `{ null: true }` in the options.) - -### minimatch.makeRe(pattern, options) - -Make a regular expression object -from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### null - -Return an empty list from minimatch.match, instead of a list -containing the pattern itself. - -### nocase - -Perform a case-insensitive match. - -### cache - -An LRU cache with `.get(k)` and `.set(k,v)` methods. By -default, an instance of `node-lru-cache` is used, with 1000 max -entries. - -### slash - -If set, then `a/*` will match `a/` as well as `a/b`. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match `xyz/123/acb`. - -### partial - -Internal. Used by `minimatch.makeRe`. - -### dot - -Allow patterns to match paths starting with a period, even if -the pattern does not explicitly start with a period. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/blerg.js b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/blerg.js deleted file mode 100644 index 9eb56e2..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/blerg.js +++ /dev/null @@ -1,62 +0,0 @@ - -// Turn something like {a,b{c,d},}x{e,f} into -// ["axe", "axf", "bcxe", "bcxf", "bdxe", "bdxf", "xe", "xf"] -// Only {,} groups are expanded. While in many cases {x,y} is -// functionally equivalent to @(x|y), for the purpose of globbing -// files, only {x,y} gets expanded as multiple patterns. -minimatch.patternSet = patternSet -function patternSet (pattern) { - if (!pattern.match(/{/) || !pattern.match(/}/)) { - // shortcut - no sets. - return [pattern] - } - - // a{b,c{d,e},{f,g}h}x{y,z} - // - // t=[before set, set, after set] - // t=["a", ["b", "c{d,e}", "{f,g}h"], "x{y,z}"] - - // start walking, and note the position of the first { - // and the corresponding } - var p = pattern.indexOf("{") - , l = pattern.length - , d = 0 - , escaping = false - , inClass = false - while (++ p < l) { - switch (pattern.charAt(p)) { - case "{": - d ++ - continue - case "}": - - - - // t[2] = patternSet(t[2]) - // t = [t[0]].concat([t[1].map(patternSet)]).concat([t[2]]) - // - // t=["a",[["b"],[["cd","ce"]],[["fh","gh"]]],["xy","xz"]] - // - // // first turn into - // // [["ab"], ["acd", "ace"], ["afh", "agh"]] - // return t[1].map(function (p) { - // return p.map(function (p) { - // return t[0] + p - // }) - // }) - // // flatten into ["ab", "acd", "ace", "afh", "agh"] - // .reduce(function (l, r) { - // return l.concat(r) - // }, []) - // // tack all the endings onto each one - // .map(function (p) { - // return t[2].map(function (e) { - // return p + e - // }) - // }) - // // flatten again - // .reduce(function (l, r) { - // return l.concat(r) - // }, []) -} - diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/minimatch.js b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/minimatch.js deleted file mode 100644 index c50ab71..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,372 +0,0 @@ -// This is a JavaScript implementation of the fnmatch-like -// stuff that git uses in its .gitignore files. -// See `man 5 gitignore`. - -module.exports = minimatch - -var path = require("path") - , LRU = require("lru-cache") - -minimatch.filter = function (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -minimatch.match = function (list, pattern, options) { - if (!options) options = {} - var ret = list.filter(minimatch.filter(pattern, options)) - if (options.debug) console.error("\nmatch: %s %j %j", pattern, list, ret) - - // set the null flag to allow empty match sets - // Note that minimatch itself, and filter(), do not - // respect this flag, only minimatch.match(list, pattern) does. - if (!options.null && !ret.length) { - return [pattern] - } - - return ret -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - options = options || {} - - // to set the cache, just replace with a different obj - // supporting set(k,v) and v=get(k) methods. - var cache = options.cache || minimatch.cache - if (!cache) cache = minimatch.cache = new LRU(1000) - - // "" only matches "" - if (!pattern) return p === "" - - // comments. - if (pattern.trim().charAt(0) === "#") return false - - // check the cache - var re = cache.get(pattern + "\n" + JSON.stringify(options)) - if (!re && re !== false) { - cache.set(pattern, re = minimatch.makeRe(pattern, options)) - } - - if (options.debug) { - console.error(pattern + "\t" + re, JSON.stringify(p)) - } - - // some kind of invalid thing - if (!re) return false - - - // patterns that end in / can only match dirs - // however, dirs also match the same thing that *doesn't* - // end in a slash. - var match = - // a/ should not match a/*, but will match */ - // accomplish this by not applying the regexp - // directly, unless the pattern would match - // trailing slash'ed things, or the thing isn't - // a trailing slash, or slashes are opted-in - ( ( options.slash || - p.substr(-1) !== "/" || - pattern.substr(-1) === "/" ) - && !!p.match(re) ) - - // a/ should match * or a - || ( p.substr(-1) === "/" && - !!p.slice(0, -1).match(re) ) - - // a pattern with *no* slashes will match against - // either the full path, or just the basename. - || ( options.matchBase && - pattern.indexOf("/") === -1 && - path.basename(p).match(re) ) - - //console.error(" MINIMATCH: %j %j %j %j", - // re.toString(), pattern, p, match) - return match -} - -minimatch.makeRe = makeRe -function makeRe (pattern, options) { - options = options || {} - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case "*": - re += oneStar - break - case "?": - re += "." - break - default: - re += "\\"+stateChar - break - } - stateChar = false - } - } - - var braceDepth = 0 - , re = "" - , escaping = false - , oneStar = options.dot ? "[^\\/]*?" - : "(?:(?!(?:\\\/|^)\\.)[^\\/])*?" - , twoStar = options.dot ? ".*?" - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - : "(?:(?!(?:\\\/|^)\\.).)*?" - , reSpecials = "().*{}+?[]^$/\\" - , patternListStack = [] - , stateChar - , negate = false - , negating = false - , inClass = false - , reClassStart = -1 - , classStart = -1 - , classStartPattern = options.dot ? "" - : "(?:(?!(?:\\\/|^)\\.)" - , classEndPattern = options.dot ? "" : ")" - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%s\t%s %s %j", pattern, i, re, c) - } - - switch (c) { - case "\\": - if (stateChar) { - if (stateChar === "*") re += oneStar - else re += "\\" + stateChar - stateChar = false - } - if (escaping) { - re += "\\\\" // must match literal \ - escaping = false - } else { - escaping = true - } - continue - - // the various stateChar values - case "!": - if (i === 0 || negating) { - negate = !negate - negating = true - break - } else { - negating = false - } - // fallthrough - case "+": - case "@": - case "*": - case "?": - if (options.debug) { - console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c) - } - - negating = false - if (escaping) { - re += "\\" + c - escaping = false - } else if (inClass) { - re += c - } else if (c === "*" && stateChar === "*") { // ** - re += twoStar - stateChar = false - } else { - if (stateChar) { - if (stateChar === "*") re += oneStar - else if (stateChar === "?") re += "." - else re += "\\" + stateChar - } - stateChar = c - } - continue - - case "(": - if (escaping) { - re += "\\(" - escaping = false - } else if (inClass) { - re += "(" - } else if (stateChar) { - plType = stateChar - patternListStack.push(plType) - re += stateChar === "!" ? "(?!" : "(?:" - stateChar = false - } else { - re += "\\(" - } - continue - - case ")": - if (escaping || inClass) { - re += "\\)" - escaping = false - } else if (patternListStack.length) { - re += ")" - plType = patternListStack.pop() - switch (plType) { - case "?": - case "+": - case "*": re += plType - case "!": - case "@": break - } - } else { - re += "\\)" - } - continue - - case "|": - if (escaping || inClass) { - re += "\\|" - escaping = false - } else if (patternListStack.length) { - re += "|" - } else { - re += "\\|" - } - continue - - // these are mostly the same in regexp and glob :) - case "[": - // swallow any state-tracking char before the [ - clearStateChar() - - if (escaping || inClass) { - re += "\\" + c - escaping = false - } else { - inClass = true - classStart = i - reClassStart = re.length - re += classStartPattern - re += c - } - continue - - case "]": - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1) escaping = true - - if (escaping || !inClass) { - re += "\\" + c - escaping = false - } else { - inClass = false - re += c + classEndPattern - } - continue - - case "{": - if (escaping || inClass) { - re += "\\{" - escaping = false - } else { - re += "(?:" - braceDepth ++ - } - continue - - case "}": - if (escaping || inClass || braceDepth === 0) { - re += "\\}" - escaping = false - } else { - // swallow any state char that wasn't consumed - clearStateChar() - re += ")" - braceDepth -- - } - continue - - case ",": - if (escaping || inClass || braceDepth === 0) { - re += "," - escaping = false - } else { - // swallow any state char that wasn't consumed - clearStateChar() - re += "|" - } - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials.indexOf(c) !== -1 - && !(c === "^" && inClass)) { - re += "\\" - } - - re += c - - } // switch - - if (negating && c !== "!") negating = false - - } // for - - // handle trailing things that only matter at the very end. - if (stateChar) { - clearStateChar() - } else if (escaping) { - re += "\\\\" - } - - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - var cs = re.substr(reClassStart + classStartPattern.length + 1) - , csOpts = Object.create(options) - csOpts.partial = true - - re = re.substr(0, reClassStart) + "\\[" - + makeRe(cs, csOpts) - } - - if (options.partial) return re - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = "^" + re + "$" - - // fail on the pattern, but allow anything otherwise. - if (negate) re = "^(?!" + re + ").*$" - - // really insane glob patterns can cause bad things. - var flags = "" - if (options.nocase) flags += "i" - - if (options.debug) { - console.error("/%s/%s", re, flags) - } - - try { - return new RegExp(re, flags) - } catch(ex) { - return false - } -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 0f3908d..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -Usage: - - var LRU = require("lru-cache") - , cache = LRU(10) // max 10 items. default = Infinity - cache.set("key", "value") - cache.get("key") // "value" - - cache.reset() // empty the cache - -RTFS for more info. diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index c3e4feb..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,106 +0,0 @@ -;(function () { // closure for web browsers - -if (module) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - ;(function () { return this })().LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function LRUCache (maxLength) { - if (!(this instanceof LRUCache)) { - return new LRUCache(maxLength) - } - var cache = {} // hash of items by key - , lruList = {} // list of items in order of use recency - , lru = 0 // least recently used - , mru = 0 // most recently used - , length = 0 // number of items in the list - - // resize the cache when the maxLength changes. - Object.defineProperty(this, "maxLength", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - maxLength = mL - // if it gets above double maxLength, trim right away. - // otherwise, do it whenever it's convenient. - if (length > maxLength) trim() - } - , get : function () { return maxLength } - , enumerable : true - }) - - this.maxLength = maxLength - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - this.reset = function () { - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - this.get(key) - cache[key].value = value - return undefined - } - var hit = {key:key, value:value, lu:mru++} - lruList[hit.lu] = cache[key] = hit - length ++ - if (length > maxLength) trim() - } - - this.get = function (key) { - if (!hOP(cache, key)) return undefined - var hit = cache[key] - delete lruList[hit.lu] - if (hit.lu === lru) lruWalk() - hit.lu = mru ++ - lruList[hit.lu] = hit - return hit.value - } - - this.del = function (key) { - if (!hOP(cache, key)) return undefined - var hit = cache[key] - delete cache[key] - delete lruList[hit.lu] - if (hit.lu === lru) lruWalk() - length -- - } - - function lruWalk () { - // lru has been deleted, hop up to the next hit. - lru = Object.keys(lruList).shift() - } - - function trim () { - if (length <= maxLength) return undefined - var prune = Object.keys(lruList).slice(0, length - maxLength) - for (var i = 0, l = (length - maxLength); i < l; i ++) { - delete cache[ lruList[prune[i]].key ] - delete lruList[prune[i]] - } - length = maxLength - lruWalk() - } -} - -})() diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index c2be62d..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "1.0.6", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "scripts": { - "test": "tap test" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "0" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_id": "lru-cache@1.0.6", - "dependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.12", - "_nodeVersion": "v0.7.7-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "aa50f97047422ac72543bda177a9c9d018d98452", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-1.0.6.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "aa50f97047422ac72543bda177a9c9d018d98452", - "_from": "lru-cache@>=1.0.2 <1.1.0", - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.6.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index f6d7a6d..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,117 +0,0 @@ -var test = require('tap').test - , LRU = require('../') - -test('basic', function (t) { - var cache = new LRU(10) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.maxLength, 10) - t.end() -}) - -test('least recently set', function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test('lru recently gotten', function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test('del', function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test('maxLength', function (t) { - var cache = new LRU(3) - - // test changing the maxLength, verify that the LRU items get dropped. - cache.maxLength = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.maxLength = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the maxLength restriction, and try again. - cache.maxLength = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.maxLength = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test('reset', function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.maxLength, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - -// Note: `.dump()` is a debugging tool only. No guarantees are made -// about the format/layout of the response. -test('dump', function (t) { - var cache = new LRU(10) - var d = cache.dump(); - t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") - cache.set("a", "A") - var d = cache.dump() // { a: { key: 'a', value: 'A', lu: 0 } } - t.ok(d.a) - t.equal(d.a.key, 'a') - t.equal(d.a.value, 'A') - t.equal(d.a.lu, 0) - - cache.set("b", "B") - cache.get("b") - d = cache.dump() - t.ok(d.b) - t.equal(d.b.key, 'b') - t.equal(d.b.value, 'B') - t.equal(d.b.lu, 2) - - t.end() -}) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/package.json b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/package.json deleted file mode 100644 index 5e962b8..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "0.0.5", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "lru-cache": "~1.0.2" - }, - "devDependencies": { - "tap": "~0.0.5" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - } - ], - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_id": "minimatch@0.0.5", - "_engineSupported": true, - "_npmVersion": "1.1.0-beta-0", - "_nodeVersion": "v0.6.6-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "96bb490bbd3ba6836bbfac111adf75301b1584de", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-0.0.5.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "96bb490bbd3ba6836bbfac111adf75301b1584de", - "_from": "minimatch@>=0.0.0 <0.1.0", - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.0.5.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/t.js b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/t.js deleted file mode 100644 index e67bf88..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/t.js +++ /dev/null @@ -1,4 +0,0 @@ -console.error(Object.keys(global).length) -var m = require("./") -console.log(m.makeRe("**")) -console.error(Object.keys(global).length) diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/test/basic.js b/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/test/basic.js deleted file mode 100644 index f4f585f..0000000 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,167 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - ; [ "http://www.bashcookbook.com/bashinfo" + - "/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"]] - // allow null glob expansion - , ["X*", [], { null: true }] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"]] - , ["\\**", ["\\**"]] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - - , ["\\.\\./*/", ["\\.\\./*/"]] - , ["s/\\..*//", ["s/\\..*//"]] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"]] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"]] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["[/\\\\]*", ["/tmp"], null, ["/tmp"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - ].forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var r = mm.makeRe(pattern, options) - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - - var actual = mm.match(f, pattern, options) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/node_modules/jsdoc/node_modules/jshint/package.json b/node_modules/jsdoc/node_modules/jshint/package.json deleted file mode 100644 index 37b3c60..0000000 --- a/node_modules/jsdoc/node_modules/jshint/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "jshint", - "version": "0.9.1", - "description": "A CLI for JSHint", - "homepage": "http://github.com/jshint/node-jshint", - "author": { - "name": "Brent Lintner", - "email": "brent.lintner@gmail.com", - "url": "http://github.com/brentlintner" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - } - ], - "bin": { - "jshint": "./bin/hint" - }, - "main": "packages/jshint/jshint", - "files": [ - "packages/jshint/README.markdown", - "packages/jshint/jshint.js", - "README.md", - "LICENSE", - "bin/hint", - "lib" - ], - "dependencies": { - "cli": "0.4.3", - "minimatch": "0.0.x" - }, - "devDependencies": { - "jasmine-node": "1.0.x" - }, - "preferGlobal": true, - "_id": "jshint@0.9.1", - "dist": { - "shasum": "ff32ec7f09f84001f7498eeafd63c9e4fbb2dc0e", - "tarball": "http://registry.npmjs.org/jshint/-/jshint-0.9.1.tgz" - }, - "_npmVersion": "1.1.59", - "_npmUser": { - "name": "antonkovalyov", - "email": "anton@kovalyov.net" - }, - "maintainers": [ - { - "name": "brentlintner", - "email": "brent.lintner@gmail.com" - }, - { - "name": "antonkovalyov", - "email": "anton@kovalyov.net" - } - ], - "directories": {}, - "_shasum": "ff32ec7f09f84001f7498eeafd63c9e4fbb2dc0e", - "_from": "jshint@0.9.1", - "_resolved": "https://registry.npmjs.org/jshint/-/jshint-0.9.1.tgz" -} diff --git a/node_modules/jsdoc/node_modules/jshint/packages/jshint/README.md b/node_modules/jsdoc/node_modules/jshint/packages/jshint/README.md deleted file mode 100755 index 3a27978..0000000 --- a/node_modules/jsdoc/node_modules/jshint/packages/jshint/README.md +++ /dev/null @@ -1,104 +0,0 @@ -JSHint, A Static Code Analysis Tool for JavaScript -================================================== - -JSHint is a community-driven tool to detect errors and potential problems in -JavaScript code and to enforce your team's coding conventions. - -**IMPORTANT**: - - * This README is for people who are thinking about contributing to JSHint. For general usage - please refer to [our website](http://jshint.com/). - * If you want to report a bug about the website, please go to the - [jshint/site](https://github.com/jshint/site/) repository. - * If you want to report a bug or contribute to our NPM package, please go to the - [jshint/node-jshint](https://github.com/jshint/node-jshint/) repository. - -Reporting a bug ---------------- - -To report a bug simply create a [new GitHub Issue](https://github.com/jshint/jshint/issues/new) and -describe your problem or suggestion. We welcome all kind of feedback regarding JSHint including but -not limited to: - - * When JSHint doesn't work as expected - * When JSHint complains about valid JavaScript code that works in all browsers - * When you simply want a new option or feature - -Please, before reporting a bug look around to see if there are any open or closed tickets that -cover your issue. And remember the wisdom: pull request > bug report > tweet. - -Submitting patches ------------------- - -The best way to make sure your issue is addressed is to submit a patch. GitHub provides a very -nice interface--pull requests--for that but we accept patches through all mediums: email, issue -comment, tweet with a link to a snippet, etc. - -Before submitting a patch make sure that you comply to our style. We don't have specific style -guide so just look around the code you are changing. - -Also, make sure that you write tests for new features and make sure that all tests pass before -submitting a patch. Patches that break the build will be rejected. - -**FEATURE FREEZE**: Please note that we currently have a feature freeze on new environments and -styling options. The only patches we accept at this time are for bug fixes. - -Tests ------ - -To run tests you will need to install [node.js](http://nodejs.org/) and -expresso. You can install the latter with npm: - - npm install expresso - -After that, running the unit tests is as easy as: - - expresso tests/unit/*.js - -Attribution ------------ - -Core Team members: - - * [Anton Kovalyov](http://anton.kovalyov.net/) ([@valueof](http://twitter.com/valueof)) - * [Wolfgang Kluge](http://klugesoftware.de/) ([blog](http://gehirnwindung.de/)) - * [Josh Perez](http://www.goatslacker.com/) ([@goatslacker](http://twitter.com/goatslacker)) - -Maintainer: Anton Kovalyov - -License -------- - -JSHint is licensed under the same slightly modified MIT license that JSLint is. -It stops evil-doers everywhere. - -JSHint is a derivative work of JSLint: - -Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -JSHint was forked from the 2010-12-16 edition of JSLint. - -Thank you! ----------- - -We really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint! diff --git a/node_modules/jsdoc/node_modules/jshint/packages/jshint/jshint.js b/node_modules/jsdoc/node_modules/jshint/packages/jshint/jshint.js deleted file mode 100644 index 53724f5..0000000 --- a/node_modules/jsdoc/node_modules/jshint/packages/jshint/jshint.js +++ /dev/null @@ -1,4832 +0,0 @@ -/*! - * JSHint, by JSHint Community. - * - * Licensed under the same slightly modified MIT license that JSLint is. - * It stops evil-doers everywhere. - * - * JSHint is a derivative work of JSLint: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * The Software shall be used for Good, not Evil. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * JSHint was forked from the 2010-12-16 edition of JSLint. - * - */ - -/* - JSHINT is a global function. It takes two parameters. - - var myResult = JSHINT(source, option); - - The first parameter is either a string or an array of strings. If it is a - string, it will be split on '\n' or '\r'. If it is an array of strings, it - is assumed that each string represents one line. The source can be a - JavaScript text or a JSON text. - - The second parameter is an optional object of options which control the - operation of JSHINT. Most of the options are booleans: They are all - optional and have a default value of false. One of the options, predef, - can be an array of names, which will be used to declare global variables, - or an object whose keys are used as global names, with a boolean value - that determines if they are assignable. - - If it checks out, JSHINT returns true. Otherwise, it returns false. - - If false, you can inspect JSHINT.errors to find out the problems. - JSHINT.errors is an array of objects containing these members: - - { - line : The line (relative to 1) at which the lint was found - character : The character (relative to 1) at which the lint was found - reason : The problem - evidence : The text line in which the problem occurred - raw : The raw message before the details were inserted - a : The first detail - b : The second detail - c : The third detail - d : The fourth detail - } - - If a fatal error was found, a null will be the last element of the - JSHINT.errors array. - - You can request a data structure which contains JSHint's results. - - var myData = JSHINT.data(); - - It returns a structure with this form: - - { - errors: [ - { - line: NUMBER, - character: NUMBER, - reason: STRING, - evidence: STRING - } - ], - functions: [ - name: STRING, - line: NUMBER, - character: NUMBER, - last: NUMBER, - lastcharacter: NUMBER, - param: [ - STRING - ], - closure: [ - STRING - ], - var: [ - STRING - ], - exception: [ - STRING - ], - outer: [ - STRING - ], - unused: [ - STRING - ], - global: [ - STRING - ], - label: [ - STRING - ] - ], - globals: [ - STRING - ], - member: { - STRING: NUMBER - }, - unused: [ - { - name: STRING, - line: NUMBER - } - ], - implieds: [ - { - name: STRING, - line: NUMBER - } - ], - urls: [ - STRING - ], - json: BOOLEAN - } - - Empty arrays will not be included. - -*/ - -/*jshint - evil: true, nomen: false, onevar: false, regexp: false, strict: true, boss: true, - undef: true, maxlen: 100, indent: 4, quotmark: double, unused: true -*/ - -/*members "\b", "\t", "\n", "\f", "\r", "!=", "!==", "\"", "%", "(begin)", - "(breakage)", "(character)", "(context)", "(error)", "(explicitNewcap)", "(global)", - "(identifier)", "(last)", "(lastcharacter)", "(line)", "(loopage)", "(metrics)", - "(name)", "(onevar)", "(params)", "(scope)", "(statement)", "(verb)", "(tokens)", "(catch)", - "*", "+", "++", "-", "--", "\/", "<", "<=", "==", - "===", ">", ">=", $, $$, $A, $F, $H, $R, $break, $continue, $w, Abstract, Ajax, - __filename, __dirname, ActiveXObject, Array, ArrayBuffer, ArrayBufferView, Audio, - Autocompleter, Asset, Boolean, Builder, Buffer, Browser, Blob, COM, CScript, Canvas, - CustomAnimation, Class, Control, ComplexityCount, Chain, Color, Cookie, Core, DataView, Date, - Debug, Draggable, Draggables, Droppables, Document, DomReady, DOMEvent, DOMReady, DOMParser, - Drag, E, Enumerator, Enumerable, Element, Elements, Error, Effect, EvalError, Event, - Events, FadeAnimation, Field, Flash, Float32Array, Float64Array, Form, - FormField, Frame, FormData, Function, Fx, GetObject, Group, Hash, HotKey, - HTMLElement, HTMLAnchorElement, HTMLBaseElement, HTMLBlockquoteElement, - HTMLBodyElement, HTMLBRElement, HTMLButtonElement, HTMLCanvasElement, HTMLDirectoryElement, - HTMLDivElement, HTMLDListElement, HTMLFieldSetElement, - HTMLFontElement, HTMLFormElement, HTMLFrameElement, HTMLFrameSetElement, - HTMLHeadElement, HTMLHeadingElement, HTMLHRElement, HTMLHtmlElement, - HTMLIFrameElement, HTMLImageElement, HTMLInputElement, HTMLIsIndexElement, - HTMLLabelElement, HTMLLayerElement, HTMLLegendElement, HTMLLIElement, - HTMLLinkElement, HTMLMapElement, HTMLMenuElement, HTMLMetaElement, - HTMLModElement, HTMLObjectElement, HTMLOListElement, HTMLOptGroupElement, - HTMLOptionElement, HTMLParagraphElement, HTMLParamElement, HTMLPreElement, - HTMLQuoteElement, HTMLScriptElement, HTMLSelectElement, HTMLStyleElement, - HtmlTable, HTMLTableCaptionElement, HTMLTableCellElement, HTMLTableColElement, - HTMLTableElement, HTMLTableRowElement, HTMLTableSectionElement, - HTMLTextAreaElement, HTMLTitleElement, HTMLUListElement, HTMLVideoElement, - Iframe, IframeShim, Image, importScripts, Int16Array, Int32Array, Int8Array, - Insertion, InputValidator, JSON, Keyboard, Locale, LN10, LN2, LOG10E, LOG2E, - MAX_VALUE, MIN_VALUE, Map, Mask, Math, MenuItem, MessageChannel, MessageEvent, MessagePort, - MoveAnimation, MooTools, MutationObserver, NaN, Native, NEGATIVE_INFINITY, Node, NodeFilter, - Number, Object, ObjectRange, - Option, Options, OverText, PI, POSITIVE_INFINITY, PeriodicalExecuter, Point, Position, Prototype, - RangeError, Rectangle, ReferenceError, RegExp, ResizeAnimation, Request, RotateAnimation, Set, - SQRT1_2, SQRT2, ScrollBar, ScriptEngine, ScriptEngineBuildVersion, - ScriptEngineMajorVersion, ScriptEngineMinorVersion, Scriptaculous, Scroller, - Slick, Slider, Selector, SharedWorker, String, Style, SyntaxError, Sortable, Sortables, - SortableObserver, Sound, Spinner, System, Swiff, Text, TextArea, Template, - Timer, Tips, Type, TypeError, Toggle, Try, "use strict", unescape, URI, URIError, URL, - VBArray, WeakMap, WSH, WScript, XDomainRequest, Web, Window, XMLDOM, XMLHttpRequest, XMLSerializer, - XPathEvaluator, XPathException, XPathExpression, XPathNamespace, XPathNSResolver, XPathResult, - "\\", a, abs, addEventListener, address, alert, apply, applicationCache, arguments, arity, - asi, atob, b, basic, basicToken, bitwise, blacklist, block, blur, boolOptions, boss, - browser, btoa, c, call, callee, caller, camelcase, cases, charAt, charCodeAt, character, - clearInterval, clearTimeout, close, closed, closure, comment, complexityCount, condition, - confirm, console, constructor, content, couch, create, css, curly, d, data, datalist, dd, debug, - decodeURI, decodeURIComponent, defaultStatus, defineClass, deserialize, devel, document, - dojo, dijit, dojox, define, else, emit, encodeURI, encodeURIComponent, elem, - eqeq, eqeqeq, eqnull, errors, es5, escape, esnext, eval, event, evidence, evil, - ex, exception, exec, exps, expr, exports, FileReader, first, floor, focus, forEach, - forin, fragment, frames, from, fromCharCode, fud, funcscope, funct, function, functions, - g, gc, getComputedStyle, getRow, getter, getterToken, GLOBAL, global, globals, globalstrict, - hasOwnProperty, help, history, i, id, identifier, immed, implieds, importPackage, include, - indent, indexOf, init, ins, internals, instanceOf, isAlpha, isApplicationRunning, isArray, - isDigit, isFinite, isNaN, iterator, java, join, jshint, - JSHINT, json, jquery, jQuery, keys, label, labelled, last, lastcharacter, lastsemic, laxbreak, - laxcomma, latedef, lbp, led, left, length, line, load, loadClass, localStorage, location, - log, loopfunc, m, match, max, maxcomplexity, maxdepth, maxerr, maxlen, maxstatements, maxparams, - member, message, meta, module, moveBy, moveTo, mootools, multistr, name, navigator, new, newcap, - nestedBlockDepth, noarg, node, noempty, nomen, nonew, nonstandard, nud, onbeforeunload, onblur, - onerror, onevar, onecase, onfocus, onload, onresize, onunload, open, openDatabase, openURL, - opener, opera, options, outer, param, parent, parseFloat, parseInt, passfail, plusplus, - postMessage, pop, predef, print, process, prompt, proto, prototype, prototypejs, provides, push, - quit, quotmark, range, raw, reach, reason, regexp, readFile, readUrl, regexdash, - removeEventListener, replace, report, require, reserved, resizeBy, resizeTo, resolvePath, - resumeUpdates, respond, rhino, right, runCommand, scroll, scope, screen, scripturl, scrollBy, - scrollTo, scrollbar, search, seal, self, send, serialize, sessionStorage, setInterval, setTimeout, - setter, setterToken, shift, slice, smarttabs, sort, spawn, split, statement, statementCount, stack, - status, start, strict, sub, substr, supernew, shadow, supplant, sum, sync, test, toLowerCase, - toString, toUpperCase, toint32, token, tokens, top, trailing, type, typeOf, Uint16Array, - Uint32Array, Uint8Array, undef, undefs, unused, urls, validthis, value, valueOf, var, vars, - version, verifyMaxParametersPerFunction, verifyMaxStatementsPerFunction, - verifyMaxComplexityPerFunction, verifyMaxNestedBlockDepthPerFunction, WebSocket, withstmt, white, - window, windows, Worker, worker, wsh, yui, YUI, Y, YUI_config*/ - -/*global exports: false */ - -// We build the application inside a function so that we produce only a single -// global variable. That function will be invoked immediately, and its return -// value is the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - -// These are operators that should not be used with the ! operator. - - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, - // alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es5 : true, // if ES5 syntax should be allowed - esnext : true, // if es.next specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - globalstrict: true, // if global "use strict"; should be allowed (also - // enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - latedef : true, // if the use before definition should not be tolerated - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - onecase : true, // if one case switch statements should be allowed - passfail : true, // if the scan should stop on first error - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - regexdash : true, // if unescaped first/last dash (-) inside brackets - // should be tolerated - regexp : true, // if the . should not be allowed in regexp literals - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - unused : true, // if variables should be always used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true // YUI variables should be predefined - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false // {int} max cyclomatic complexity per function - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus : true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows : "wsh" - }, - - - // browser contains a set of global names which are commonly provided by a - // web browser environment. - browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement : false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement : false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement : false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false - }, - - couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false - }, - - declared, // Globals that were declared using /*global ... */ syntax. - - devel = { - alert : false, - confirm : false, - console : false, - Debug : false, - opera : false, - prompt : false - }, - - dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require" : false - }, - - funct, // The current function - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - jsonmode, - - jquery = { - "$" : false, - jQuery : false - }, - - lines, - lookahead, - member, - membersOnly, - - mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator : false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false - }, - - nexttoken, - - node = { - __filename : false, - __dirname : false, - Buffer : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval : false - }, - - noreach, - option, - predefined, // Global variables defined by option - prereg, - prevtoken, - - prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false - }, - - quotmark, - - rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false - }, - - scope, // The current scope - stack, - - // standard contains the global names that are provided by the - // ECMAScript standard. - standard = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Map : false, - Math : false, - NaN : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false - }, - - // widely adopted global names that are not part of ECMAScript standard - nonstandard = { - escape : false, - unescape : false - }, - - directive, - syntax = {}, - tab, - token, - unuseds, - urls, - useESNextSyntax, - warnings, - - worker = { - importScripts : true, - postMessage : true, - self : true - }, - - wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true - }, - - yui = { - YUI : false, - Y : false, - YUI_config : false - }; - // Regular expressions. Some of these are stupidly long. - var ax, cx, tx, nx, nxg, lx, ix, jx, ft; - (function () { - /*jshint maxlen:300 */ - - // unsafe comment or string - ax = /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - - // unsafe characters that are silently deleted by one or more browsers - cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - - // token - tx = /^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/=(?!(\S*\/[gim]?))|\/(\*(jshint|jslint|members?|global)?|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/; - - // characters in strings that need escapement - nx = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - nxg = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - - // star slash - lx = /\*\//; - - // identifier - ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - - // javascript url - jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - // catches /* falls through */ comments - ft = /^\s*\/\*\s*falls\sthrough\s*\*\/\s*$/; - }()); - - function F() {} // Used by Object.create - - function is_own(object, name) { - // The object.hasOwnProperty method fails when the property under consideration - // is named 'hasOwnProperty'. So we have to use this more convoluted form. - return Object.prototype.hasOwnProperty.call(object, name); - } - - function checkOption(name, t) { - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - warning("Bad option: '" + name + "'.", t); - } - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - // Provide critical ES5 functions to ES3. - - if (typeof Array.isArray !== "function") { - Array.isArray = function (o) { - return Object.prototype.toString.apply(o) === "[object Array]"; - }; - } - - if (!Array.prototype.forEach) { - Array.prototype.forEach = function (fn, scope) { - var len = this.length; - - for (var i = 0; i < len; i++) { - fn.call(scope || this, this[i], i, this); - } - }; - } - - if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { - if (this === null || this === undefined) { - throw new TypeError(); - } - - var t = new Object(this); - var len = t.length >>> 0; - - if (len === 0) { - return -1; - } - - var n = 0; - if (arguments.length > 0) { - n = Number(arguments[1]); - if (n != n) { // shortcut for verifying if it's NaN - n = 0; - } else if (n !== 0 && n != Infinity && n != -Infinity) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - } - - if (n >= len) { - return -1; - } - - var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); - for (; k < len; k++) { - if (k in t && t[k] === searchElement) { - return k; - } - } - - return -1; - }; - } - - if (typeof Object.create !== "function") { - Object.create = function (o) { - F.prototype = o; - return new F(); - }; - } - - if (typeof Object.keys !== "function") { - Object.keys = function (o) { - var a = [], k; - for (k in o) { - if (is_own(o, k)) { - a.push(k); - } - } - return a; - }; - } - - // Non standard methods - - function isAlpha(str) { - return (str >= "a" && str <= "z\uffff") || - (str >= "A" && str <= "Z\uffff"); - } - - function isDigit(str) { - return (str >= "0" && str <= "9"); - } - - function isIdentifier(token, value) { - if (!token) - return false; - - if (!token.identifier || token.value !== value) - return false; - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (is_own(o, n) && !is_own(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (option.couch) { - combine(predefined, couch); - } - - if (option.rhino) { - combine(predefined, rhino); - } - - if (option.prototypejs) { - combine(predefined, prototypejs); - } - - if (option.node) { - combine(predefined, node); - option.globalstrict = true; - } - - if (option.devel) { - combine(predefined, devel); - } - - if (option.dojo) { - combine(predefined, dojo); - } - - if (option.browser) { - combine(predefined, browser); - } - - if (option.nonstandard) { - combine(predefined, nonstandard); - } - - if (option.jquery) { - combine(predefined, jquery); - } - - if (option.mootools) { - combine(predefined, mootools); - } - - if (option.worker) { - combine(predefined, worker); - } - - if (option.wsh) { - combine(predefined, wsh); - } - - if (option.esnext) { - useESNextSyntax(); - } - - if (option.globalstrict && option.strict !== false) { - option.strict = true; - } - - if (option.yui) { - combine(predefined, yui); - } - } - - - // Produce an error warning. - function quit(message, line, chr) { - var percentage = Math.floor((line / lines.length) * 100); - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, m, t, a) { - return JSHINT.undefs.push([scope, m, t, a]); - } - - function warning(m, t, a, b, c, d) { - var ch, l, w; - t = t || nexttoken; - if (t.id === "(end)") { // `~ - t = token; - } - l = t.line || 0; - ch = t.from || 0; - w = { - id: "(error)", - raw: m, - evidence: lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - w.reason = supplant(m, w); - JSHINT.errors.push(w); - if (option.passfail) { - quit("Stopping. ", l, ch); - } - warnings += 1; - if (warnings >= option.maxerr) { - quit("Too many errors.", l, ch); - } - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - -// lexical analysis and token construction - - var lex = (function lex() { - var character, from, line, s; - -// Private lex methods - - function nextLine() { - var at, - match, - tw; // trailing whitespace check - - if (line >= lines.length) - return false; - - character = 1; - s = lines[line]; - line += 1; - - // If smarttabs option is used check for spaces followed by tabs only. - // Otherwise check for any occurence of mixed tabs and spaces. - // Tabs and one space followed by block comment is allowed. - if (option.smarttabs) { - // negative look-behind for "//" - match = s.match(/(\/\/)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = s.search(/ \t|\t [^\*]/); - } - - if (at >= 0) - warningAt("Mixed spaces and tabs.", line, at + 1); - - s = s.replace(/\t/g, tab); - at = s.search(cx); - - if (at >= 0) - warningAt("Unsafe character.", line, at); - - if (option.maxlen && option.maxlen < s.length) - warningAt("Line too long.", line, s.length); - - // Check for trailing whitespaces - tw = option.trailing && s.match(/^(.*?)\s+$/); - if (tw && !/^\s+$/.test(s)) { - warningAt("Trailing whitespace.", line, tw[1].length + 1); - } - return true; - } - -// Produce a token object. The token inherits from a syntax symbol. - - function it(type, value) { - var i, t; - - function checkName(name) { - if (!option.proto && name === "__proto__") { - warningAt("The '{a}' property is deprecated.", line, from, name); - return; - } - - if (!option.iterator && name === "__iterator__") { - warningAt("'{a}' is only available in JavaScript 1.7.", line, from, name); - return; - } - - // Check for dangling underscores unless we're in Node - // environment and this identifier represents built-in - // Node globals with underscores. - - var hasDangling = /^(_+.*|.*_+)$/.test(name); - - if (option.nomen && hasDangling && name !== "_") { - if (option.node && token.id !== "." && /^(__dirname|__filename)$/.test(name)) - return; - - warningAt("Unexpected {a} in '{b}'.", line, from, "dangling '_'", name); - return; - } - - // Check for non-camelcase names. Names like MY_VAR and - // _myVar are okay though. - - if (option.camelcase) { - if (name.replace(/^_+/, "").indexOf("_") > -1 && !name.match(/^[A-Z0-9_]*$/)) { - warningAt("Identifier '{a}' is not in camel case.", line, from, value); - } - } - } - - if (type === "(color)" || type === "(range)") { - t = {type: type}; - } else if (type === "(punctuator)" || - (type === "(identifier)" && is_own(syntax, value))) { - t = syntax[value] || syntax["(error)"]; - } else { - t = syntax[type]; - } - - t = Object.create(t); - - if (type === "(string)" || type === "(range)") { - if (!option.scripturl && jx.test(value)) { - warningAt("Script URL.", line, from); - } - } - - if (type === "(identifier)") { - t.identifier = true; - checkName(value); - } - - t.value = value; - t.line = line; - t.character = character; - t.from = from; - i = t.id; - if (i !== "(endline)") { - prereg = i && - (("(,=:[!&|?{};".indexOf(i.charAt(i.length - 1)) >= 0) || - i === "return" || - i === "case"); - } - return t; - } - - // Public lex methods - return { - init: function (source) { - if (typeof source === "string") { - lines = source - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } else { - lines = source; - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - if (lines[0] && lines[0].substr(0, 2) === "#!") - lines[0] = ""; - - line = 0; - nextLine(); - from = 1; - }, - - range: function (begin, end) { - var c, value = ""; - from = character; - if (s.charAt(0) !== begin) { - errorAt("Expected '{a}' and instead saw '{b}'.", - line, character, begin, s.charAt(0)); - } - for (;;) { - s = s.slice(1); - character += 1; - c = s.charAt(0); - switch (c) { - case "": - errorAt("Missing '{a}'.", line, character, c); - break; - case end: - s = s.slice(1); - character += 1; - return it("(range)", value); - case "\\": - warningAt("Unexpected '{a}'.", line, character, c); - } - value += c; - } - - }, - - - // token -- this is called by advance to get the next token - token: function () { - var b, c, captures, d, depth, high, i, l, low, q, t, isLiteral, isInRange, n; - - function match(x) { - var r = x.exec(s), r1; - - if (r) { - l = r[0].length; - r1 = r[1]; - c = r1.charAt(0); - s = s.substr(l); - from = character + l - r1.length; - character += l; - return r1; - } - } - - function string(x) { - var c, j, r = "", allowNewLine = false; - - if (jsonmode && x !== "\"") { - warningAt("Strings must use doublequote.", - line, character); - } - - if (option.quotmark) { - if (option.quotmark === "single" && x !== "'") { - warningAt("Strings must use singlequote.", - line, character); - } else if (option.quotmark === "double" && x !== "\"") { - warningAt("Strings must use doublequote.", - line, character); - } else if (option.quotmark === true) { - quotmark = quotmark || x; - if (quotmark !== x) { - warningAt("Mixed double and single quotes.", - line, character); - } - } - } - - function esc(n) { - var i = parseInt(s.substr(j + 1, n), 16); - j += n; - if (i >= 32 && i <= 126 && - i !== 34 && i !== 92 && i !== 39) { - warningAt("Unnecessary escapement.", line, character); - } - character += n; - c = String.fromCharCode(i); - } - - j = 0; -unclosedString: for (;;) { - while (j >= s.length) { - j = 0; - - var cl = line, cf = from; - if (!nextLine()) { - errorAt("Unclosed string.", cl, cf); - break unclosedString; - } - - if (allowNewLine) { - allowNewLine = false; - } else { - warningAt("Unclosed string.", cl, cf); - } - } - - c = s.charAt(j); - if (c === x) { - character += 1; - s = s.substr(j + 1); - return it("(string)", r, x); - } - - if (c < " ") { - if (c === "\n" || c === "\r") { - break; - } - warningAt("Control character in string: {a}.", - line, character + j, s.slice(0, j)); - } else if (c === "\\") { - j += 1; - character += 1; - c = s.charAt(j); - n = s.charAt(j + 1); - switch (c) { - case "\\": - case "\"": - case "/": - break; - case "\'": - if (jsonmode) { - warningAt("Avoid \\'.", line, character); - } - break; - case "b": - c = "\b"; - break; - case "f": - c = "\f"; - break; - case "n": - c = "\n"; - break; - case "r": - c = "\r"; - break; - case "t": - c = "\t"; - break; - case "0": - c = "\0"; - // Octal literals fail in strict mode - // check if the number is between 00 and 07 - // where 'n' is the token next to 'c' - if (n >= 0 && n <= 7 && directive["use strict"]) { - warningAt( - "Octal literals are not allowed in strict mode.", - line, character); - } - break; - case "u": - esc(4); - break; - case "v": - if (jsonmode) { - warningAt("Avoid \\v.", line, character); - } - c = "\v"; - break; - case "x": - if (jsonmode) { - warningAt("Avoid \\x-.", line, character); - } - esc(2); - break; - case "": - // last character is escape character - // always allow new line if escaped, but show - // warning if option is not set - allowNewLine = true; - if (option.multistr) { - if (jsonmode) { - warningAt("Avoid EOL escapement.", line, character); - } - c = ""; - character -= 1; - break; - } - warningAt("Bad escapement of EOL. Use option multistr if needed.", - line, character); - break; - case "!": - if (s.charAt(j - 2) === "<") - break; - /*falls through*/ - default: - warningAt("Bad escapement.", line, character); - } - } - r += c; - character += 1; - j += 1; - } - } - - for (;;) { - if (!s) { - return it(nextLine() ? "(endline)" : "(end)", ""); - } - - t = match(tx); - - if (!t) { - t = ""; - c = ""; - while (s && s < "!") { - s = s.substr(1); - } - if (s) { - errorAt("Unexpected '{a}'.", line, character, s.substr(0, 1)); - s = ""; - } - } else { - - // identifier - - if (isAlpha(c) || c === "_" || c === "$") { - return it("(identifier)", t); - } - - // number - - if (isDigit(c)) { - if (!isFinite(Number(t))) { - warningAt("Bad number '{a}'.", - line, character, t); - } - if (isAlpha(s.substr(0, 1))) { - warningAt("Missing space after '{a}'.", - line, character, t); - } - if (c === "0") { - d = t.substr(1, 1); - if (isDigit(d)) { - if (token.id !== ".") { - warningAt("Don't use extra leading zeros '{a}'.", - line, character, t); - } - } else if (jsonmode && (d === "x" || d === "X")) { - warningAt("Avoid 0x-. '{a}'.", - line, character, t); - } - } - if (t.substr(t.length - 1) === ".") { - warningAt( -"A trailing decimal point can be confused with a dot '{a}'.", line, character, t); - } - return it("(number)", t); - } - switch (t) { - - // string - - case "\"": - case "'": - return string(t); - - // // comment - - case "//": - s = ""; - token.comment = true; - break; - - // /* comment - - case "/*": - for (;;) { - i = s.search(lx); - if (i >= 0) { - break; - } - if (!nextLine()) { - errorAt("Unclosed comment.", line, character); - } - } - s = s.substr(i + 2); - token.comment = true; - break; - - // /*members /*jshint /*global - - case "/*members": - case "/*member": - case "/*jshint": - case "/*jslint": - case "/*global": - case "*/": - return { - value: t, - type: "special", - line: line, - character: character, - from: from - }; - - case "": - break; - // / - case "/": - if (s.charAt(0) === "=") { - errorAt("A regular expression literal can be confused with '/='.", - line, from); - } - - if (prereg) { - depth = 0; - captures = 0; - l = 0; - for (;;) { - b = true; - c = s.charAt(l); - l += 1; - switch (c) { - case "": - errorAt("Unclosed regular expression.", line, from); - return quit("Stopping.", line, from); - case "/": - if (depth > 0) { - warningAt("{a} unterminated regular expression " + - "group(s).", line, from + l, depth); - } - c = s.substr(0, l - 1); - q = { - g: true, - i: true, - m: true - }; - while (q[s.charAt(l)] === true) { - q[s.charAt(l)] = false; - l += 1; - } - character += l; - s = s.substr(l); - q = s.charAt(0); - if (q === "/" || q === "*") { - errorAt("Confusing regular expression.", - line, from); - } - return it("(regexp)", c); - case "\\": - c = s.charAt(l); - if (c < " ") { - warningAt( -"Unexpected control character in regular expression.", line, from + l); - } else if (c === "<") { - warningAt( -"Unexpected escaped character '{a}' in regular expression.", line, from + l, c); - } - l += 1; - break; - case "(": - depth += 1; - b = false; - if (s.charAt(l) === "?") { - l += 1; - switch (s.charAt(l)) { - case ":": - case "=": - case "!": - l += 1; - break; - default: - warningAt( -"Expected '{a}' and instead saw '{b}'.", line, from + l, ":", s.charAt(l)); - } - } else { - captures += 1; - } - break; - case "|": - b = false; - break; - case ")": - if (depth === 0) { - warningAt("Unescaped '{a}'.", - line, from + l, ")"); - } else { - depth -= 1; - } - break; - case " ": - q = 1; - while (s.charAt(l) === " ") { - l += 1; - q += 1; - } - if (q > 1) { - warningAt( -"Spaces are hard to count. Use {{a}}.", line, from + l, q); - } - break; - case "[": - c = s.charAt(l); - if (c === "^") { - l += 1; - if (s.charAt(l) === "]") { - errorAt("Unescaped '{a}'.", - line, from + l, "^"); - } - } - if (c === "]") { - warningAt("Empty class.", line, - from + l - 1); - } - isLiteral = false; - isInRange = false; -klass: do { - c = s.charAt(l); - l += 1; - switch (c) { - case "[": - case "^": - warningAt("Unescaped '{a}'.", - line, from + l, c); - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - case "-": - if (isLiteral && !isInRange) { - isLiteral = false; - isInRange = true; - } else if (isInRange) { - isInRange = false; - } else if (s.charAt(l) === "]") { - isInRange = true; - } else { - if (option.regexdash !== (l === 2 || (l === 3 && - s.charAt(1) === "^"))) { - warningAt("Unescaped '{a}'.", - line, from + l - 1, "-"); - } - isLiteral = true; - } - break; - case "]": - if (isInRange && !option.regexdash) { - warningAt("Unescaped '{a}'.", - line, from + l - 1, "-"); - } - break klass; - case "\\": - c = s.charAt(l); - if (c < " ") { - warningAt( -"Unexpected control character in regular expression.", line, from + l); - } else if (c === "<") { - warningAt( -"Unexpected escaped character '{a}' in regular expression.", line, from + l, c); - } - l += 1; - - // \w, \s and \d are never part of a character range - if (/[wsd]/i.test(c)) { - if (isInRange) { - warningAt("Unescaped '{a}'.", - line, from + l, "-"); - isInRange = false; - } - isLiteral = false; - } else if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - case "/": - warningAt("Unescaped '{a}'.", - line, from + l - 1, "/"); - - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - case "<": - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - default: - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - } - } while (c); - break; - case ".": - if (option.regexp) { - warningAt("Insecure '{a}'.", line, - from + l, c); - } - break; - case "]": - case "?": - case "{": - case "}": - case "+": - case "*": - warningAt("Unescaped '{a}'.", line, - from + l, c); - } - if (b) { - switch (s.charAt(l)) { - case "?": - case "+": - case "*": - l += 1; - if (s.charAt(l) === "?") { - l += 1; - } - break; - case "{": - l += 1; - c = s.charAt(l); - if (c < "0" || c > "9") { - warningAt( -"Expected a number and instead saw '{a}'.", line, from + l, c); - break; // No reason to continue checking numbers. - } - l += 1; - low = +c; - for (;;) { - c = s.charAt(l); - if (c < "0" || c > "9") { - break; - } - l += 1; - low = +c + (low * 10); - } - high = low; - if (c === ",") { - l += 1; - high = Infinity; - c = s.charAt(l); - if (c >= "0" && c <= "9") { - l += 1; - high = +c; - for (;;) { - c = s.charAt(l); - if (c < "0" || c > "9") { - break; - } - l += 1; - high = +c + (high * 10); - } - } - } - if (s.charAt(l) !== "}") { - warningAt( -"Expected '{a}' and instead saw '{b}'.", line, from + l, "}", c); - } else { - l += 1; - } - if (s.charAt(l) === "?") { - l += 1; - } - if (low > high) { - warningAt( -"'{a}' should not be greater than '{b}'.", line, from + l, low, high); - } - } - } - } - c = s.substr(0, l - 1); - character += l; - s = s.substr(l); - return it("(regexp)", c); - } - return it("(punctuator)", t); - - // punctuator - - case "#": - return it("(punctuator)", t); - default: - return it("(punctuator)", t); - } - } - } - } - }; - }()); - - - function addlabel(t, type, token) { - if (t === "hasOwnProperty") { - warning("'hasOwnProperty' is a really bad name."); - } - - // Define t in the current function in the current scope. - if (type === "exception") { - if (is_own(funct["(context)"], t)) { - if (funct[t] !== true && !option.node) { - warning("Value of '{a}' may be overwritten in IE.", nexttoken, t); - } - } - } - - if (is_own(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (option.latedef) - warning("'{a}' was used before it was defined.", nexttoken, t); - } else { - if (!option.shadow && type !== "exception") { - warning("'{a}' is already defined.", nexttoken, t); - } - } - } - - funct[t] = type; - - if (token) { - funct["(tokens)"][t] = token; - } - - if (funct["(global)"]) { - global[t] = funct; - if (is_own(implied, t)) { - if (option.latedef) - warning("'{a}' was used before it was defined.", nexttoken, t); - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - - - function doOption() { - var nt = nexttoken; - var o = nt.value; - var quotmarkValue = option.quotmark; - var predef = {}; - var b, obj, filter, t, tn, v, minus; - - switch (o) { - case "*/": - error("Unbegun comment."); - break; - case "/*members": - case "/*member": - o = "/*members"; - if (!membersOnly) { - membersOnly = {}; - } - obj = membersOnly; - option.quotmark = false; - break; - case "/*jshint": - case "/*jslint": - obj = option; - filter = boolOptions; - break; - case "/*global": - obj = predef; - break; - default: - error("What?"); - } - - t = lex.token(); -loop: for (;;) { - minus = false; - for (;;) { - if (t.type === "special" && t.value === "*/") { - break loop; - } - if (t.id !== "(endline)" && t.id !== ",") { - break; - } - t = lex.token(); - } - - if (o === "/*global" && t.value === "-") { - minus = true; - t = lex.token(); - } - - if (t.type !== "(string)" && t.type !== "(identifier)" && o !== "/*members") { - error("Bad option.", t); - } - - v = lex.token(); - if (v.id === ":") { - v = lex.token(); - - if (obj === membersOnly) { - error("Expected '{a}' and instead saw '{b}'.", t, "*/", ":"); - } - - if (o === "/*jshint") { - checkOption(t.value, t); - } - - var numericVals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (numericVals.indexOf(t.value) > -1 && (o === "/*jshint" || o === "/*jslint")) { - b = +v.value; - - if (typeof b !== "number" || !isFinite(b) || b <= 0 || Math.floor(b) !== b) { - error("Expected a small integer and instead saw '{a}'.", v, v.value); - } - - if (t.value === "indent") - obj.white = true; - - obj[t.value] = b; - } else if (t.value === "validthis") { - if (funct["(global)"]) { - error("Option 'validthis' can't be used in a global scope."); - } else { - if (v.value === "true" || v.value === "false") - obj[t.value] = v.value === "true"; - else - error("Bad option value.", v); - } - } else if (t.value === "quotmark" && (o === "/*jshint")) { - switch (v.value) { - case "true": - obj.quotmark = true; - break; - case "false": - obj.quotmark = false; - break; - case "double": - case "single": - obj.quotmark = v.value; - break; - default: - error("Bad option value.", v); - } - } else if (v.value === "true" || v.value === "false") { - if (o === "/*jslint") { - tn = renamedOptions[t.value] || t.value; - obj[tn] = v.value === "true"; - if (invertedOptions[tn] !== undefined) { - obj[tn] = !obj[tn]; - } - } else { - obj[t.value] = v.value === "true"; - } - - if (t.value === "newcap") - obj["(explicitNewcap)"] = true; - } else { - error("Bad option value.", v); - } - t = lex.token(); - } else { - if (o === "/*jshint" || o === "/*jslint") { - error("Missing option value.", t); - } - - obj[t.value] = false; - - if (o === "/*global" && minus === true) { - JSHINT.blacklist[t.value] = t.value; - updatePredefined(); - } - - t = v; - } - } - - if (o === "/*members") { - option.quotmark = quotmarkValue; - } - - combine(predefined, predef); - - for (var key in predef) { - if (is_own(predef, key)) { - declared[key] = nt; - } - } - - if (filter) { - assume(); - } - } - - -// We need a peek function. If it has an argument, it peeks that much farther -// ahead. It is used to distinguish -// for ( var i in ... -// from -// for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - - -// Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (token.id) { - case "(number)": - if (nexttoken.id === ".") { - warning("A dot following a number can be confused with a decimal point.", token); - } - break; - case "-": - if (nexttoken.id === "-" || nexttoken.id === "--") { - warning("Confusing minusses."); - } - break; - case "+": - if (nexttoken.id === "+" || nexttoken.id === "++") { - warning("Confusing plusses."); - } - break; - } - - if (token.type === "(string)" || token.identifier) { - anonname = token.value; - } - - if (id && nexttoken.id !== id) { - if (t) { - if (nexttoken.id === "(end)") { - warning("Unmatched '{a}'.", t, t.id); - } else { - warning("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - nexttoken, id, t.id, t.line, nexttoken.value); - } - } else if (nexttoken.type !== "(identifier)" || - nexttoken.value !== id) { - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, id, nexttoken.value); - } - } - - prevtoken = token; - token = nexttoken; - for (;;) { - nexttoken = lookahead.shift() || lex.token(); - if (nexttoken.id === "(end)" || nexttoken.id === "(error)") { - return; - } - if (nexttoken.type === "special") { - doOption(); - } else { - if (nexttoken.id !== "(endline)") { - break; - } - } - } - } - - -// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it -// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is -// like .nud except that it is only used on the first token of a statement. -// Having .fud makes it much easier to define statement-oriented languages like -// JavaScript. I retained Pratt's nomenclature. - -// .nud Null denotation -// .fud First null denotation -// .led Left denotation -// lbp Left binding power -// rbp Right binding power - -// They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false; - - if (nexttoken.id === "(end)") - error("Unexpected early end of program.", token); - - advance(); - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = token.value; - } - if (initial === true && token.fud) { - left = token.fud(); - } else { - if (token.nud) { - left = token.nud(); - } else { - if (nexttoken.type === "(number)" && token.id === ".") { - warning("A leading decimal point can be confused with a dot: '.{a}'.", - token, nexttoken.value); - advance(); - return token; - } else { - error("Expected an identifier and instead saw '{a}'.", - token, token.id); - } - } - while (rbp < nexttoken.lbp) { - isArray = token.value === "Array"; - isObject = token.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and token.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== token.value) { - isObject = false; - } - } - } - - advance(); - if (isArray && token.id === "(" && nexttoken.id === ")") - warning("Use the array literal notation [].", token); - if (isObject && token.id === "(" && nexttoken.id === ")") - warning("Use the object literal notation {}.", token); - if (token.led) { - left = token.led(left); - } else { - error("Expected an operator and instead saw '{a}'.", - token, token.id); - } - } - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("Unexpected space after '{a}'.", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white && (left.character !== right.from || left.line !== right.line)) { - warning("Unexpected space before '{a}'.", right, right.value); - } - } - - function nospace(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (option.white) { - left = left || token; - right = right || nexttoken; - if (left.value === ";" && right.value === ";") { - return; - } - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("Missing space after '{a}'.", - left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || token; - right = right || nexttoken; - if (!option.laxbreak && left.line !== right.line) { - warning("Bad line breaking before '{a}'.", right, right.id); - } else if (option.white) { - left = left || token; - right = right || nexttoken; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("Missing space after '{a}'.", - left, left.value); - } - } - } - - function indentation(bias) { - var i; - if (option.white && nexttoken.id !== "(end)") { - i = indent + (bias || 0); - if (nexttoken.from !== i) { - warning( -"Expected '{a}' to have an indentation at {b} instead at {c}.", - nexttoken, nexttoken.value, i, nexttoken.from); - } - } - } - - function nolinebreak(t) { - t = t || token; - if (t.line !== nexttoken.line) { - warning("Line breaking error '{a}'.", t, t.value); - } - } - - - function comma() { - if (token.line !== nexttoken.line) { - if (!option.laxcomma) { - if (comma.first) { - warning("Comma warnings can be turned off with 'laxcomma'"); - comma.first = false; - } - warning("Bad line breaking before '{a}'.", token, nexttoken.id); - } - } else if (!token.comment && token.character !== nexttoken.from && option.white) { - token.from += (token.character - token.from); - warning("Unexpected space after '{a}'.", token, token.value); - } - advance(","); - nonadjacent(token, nexttoken); - } - - -// Functional constructors for making the symbols that will be inherited by -// tokens. - - function symbol(s, p) { - var x = syntax[s]; - if (!x || typeof x !== "object") { - syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - - function delim(s) { - return symbol(s, 0); - } - - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (option.plusplus) { - warning("Unexpected use of '{a}'.", this, this.id); - } else if ((!this.right.identifier || this.right.reserved) && - this.right.id !== "." && this.right.id !== "[") { - warning("Bad operand.", this); - } - } - return this; - }; - return x; - } - - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - - function reserve(s, f) { - var x = type(s, f); - x.identifier = x.reserved = true; - return x; - } - - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - } - if (s === "in" && left.id === "!") { - warning("Confusing use of '{a}'.", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function relation(s, f) { - var x = symbol(s, 100); - x.led = function (left) { - nobreaknonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("Use the isNaN function to compare with NaN.", this); - } else if (f) { - f.apply(this, [left, right]); - } - if (left.id === "!") { - warning("Confusing use of '{a}'.", left, "!"); - } - if (right.id === "!") { - warning("Confusing use of '{a}'.", right, "!"); - } - this.left = left; - this.right = right; - return this; - }; - return x; - } - - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("Read only.", left); - } else if (left["function"]) { - warning("'{a}' is a function.", left, left.value); - } - - if (left) { - if (option.esnext && funct[left.value] === "const") { - warning("Attempting to override '{a}' which is a constant", left, left.value); - } - - if (left.id === "." || left.id === "[") { - if (!left.left || left.left.value === "arguments") { - warning("Bad assignment.", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !left.reserved) { - if (funct[left.value] === "exception") { - warning("Do not assign to the exception parameter.", left); - } - that.right = expression(19); - return that; - } - - if (left === syntax["function"]) { - warning( -"Expected an identifier in an assignment and instead saw a function invocation.", - token); - } - } - - error("Bad assignment.", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (option.bitwise) { - warning("Unexpected use of '{a}'.", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (option.bitwise) { - warning("Unexpected use of '{a}'.", that, that.id); - } - nonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !left.reserved)) { - expression(19); - return that; - } - if (left === syntax["function"]) { - warning( -"Expected an identifier in an assignment, and instead saw a function invocation.", - token); - } - return that; - } - error("Bad assignment.", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - x.led = function (left) { - if (option.plusplus) { - warning("Unexpected use of '{a}'.", this, this.id); - } else if ((!left.identifier || left.reserved) && - left.id !== "." && left.id !== "[") { - warning("Bad operand.", this); - } - this.left = left; - return this; - }; - return x; - } - - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - function optionalidentifier(fnparam) { - if (nexttoken.identifier) { - advance(); - if (token.reserved && !option.es5) { - // `undefined` as a function param is a common pattern to protect - // against the case when somebody does `undefined = true` and - // help with minification. More info: https://gist.github.com/315916 - if (!fnparam || token.value !== "undefined") { - warning("Expected an identifier and instead saw '{a}' (a reserved word).", - token, token.id); - } - } - return token.value; - } - } - - // fnparam means that this identifier is being defined as a function - // argument - function identifier(fnparam) { - var i = optionalidentifier(fnparam); - if (i) { - return i; - } - if (token.id === "function" && nexttoken.id === "(") { - warning("Missing name in function declaration."); - } else { - error("Expected an identifier and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (nexttoken.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!option.latedef) { - break; - } - warning( -"Inner functions should be listed at the top of the outer function.", t); - break; - } - warning("Unreachable '{a}' after '{b}'.", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var i = indent, r, s = scope, t = nexttoken; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - - if (t.identifier && !t.reserved && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!nexttoken.labelled && nexttoken.value !== "{") { - warning("Label '{a}' on {b} statement.", nexttoken, t.value, nexttoken.value); - } - - if (jx.test(t.value + ":")) { - warning("Label '{a}' looks like a javascript url.", t, t.value); - } - - nexttoken.label = t.value; - t = nexttoken; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!option.expr && (!r || !r.exps)) { - warning("Expected an assignment or function call and instead saw an expression.", - token); - } else if (option.nonew && r.id === "(" && r.left.id === "new") { - warning("Do not use 'new' for side effects.", t); - } - - if (nexttoken.id === ",") { - return comma(); - } - - if (nexttoken.id !== ";") { - if (!option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!option.lastsemic || nexttoken.id !== "}" || - nexttoken.line !== token.line) { - warningAt("Missing semicolon.", token.line, token.character); - } - } - } else { - adjacent(token, nexttoken); - advance(";"); - nonadjacent(token, nexttoken); - } - } - -// Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!nexttoken.reach && nexttoken.id !== "(end)") { - if (nexttoken.id === ";") { - p = peek(); - if (!p || p.id !== "(") { - warning("Unnecessary semicolon."); - } - advance(";"); - } else { - a.push(statement(startLine === nexttoken.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (nexttoken.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("Missing semicolon.", nexttoken); - } else { - p = pn; - } - } else if (p.id === "}") { - // directive with no other statements, warn about missing semicolon - warning("Missing semicolon.", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (directive[token.value]) { - warning("Unnecessary directive \"{a}\".", token, token.value); - } - - if (token.value === "use strict") { - if (!option["(explicitNewcap)"]) - option.newcap = true; - option.undef = true; - } - - // there's no directive negation, so always set to true - directive[token.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !option.funcscope) - scope = Object.create(scope); - - nonadjacent(token, nexttoken); - t = nexttoken; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (nexttoken.id === "{") { - advance("{"); - line = token.line; - if (nexttoken.id !== "}") { - indent += option.indent; - while (!ordinary && nexttoken.from > indent) { - indent += option.indent; - } - - if (isfunc) { - m = {}; - for (d in directive) { - if (is_own(directive, d)) { - m[d] = directive[d]; - } - } - directives(); - - if (option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !directive["use strict"]) { - warning("Missing \"use strict\" statement."); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - directive = m; - } - - indent -= option.indent; - if (line !== nexttoken.line) { - indentation(); - } - } else if (line !== nexttoken.line) { - indentation(); - } - advance("}", t); - indent = old_indent; - } else if (!ordinary) { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, "{", nexttoken.value); - } else { - if (!stmt || option.curly) - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, "{", nexttoken.value); - - noreach = true; - indent += option.indent; - // test indentation only if statement is in new line - a = [statement(nexttoken.line === token.line)]; - indent -= option.indent; - noreach = false; - } - funct["(verb)"] = null; - if (!ordinary || !option.funcscope) scope = s; - inblock = b; - if (ordinary && option.noempty && (!a || a.length === 0)) { - warning("Empty block."); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("Unexpected /*member '{a}'.", token, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(token) { - var name = token.value, line = token.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - - // The name is in scope and defined in the current function. - if (funct === s) { - // Change 'unused' to 'var', and reject labels. - switch (funct[v]) { - case "unused": - funct[v] = "var"; - break; - case "unction": - funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("'{a}' is a statement label.", token, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (option.undef && typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (nexttoken && (nexttoken.value === "." || nexttoken.value === "["))) { - - isundef(funct, "'{a}' is not defined.", token, v); - } - } - - note_implied(token); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("'{a}' used out of scope.", token, v); - break; - case "label": - warning("'{a}' is a statement label.", token, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("'{a}' is not allowed.", token, v); - note_implied(token); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // display warning if we're inside of typeof or delete. - if (option.undef) { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (nexttoken && - (nexttoken.value === "." || nexttoken.value === "["))) { - - isundef(funct, "'{a}' is not defined.", token, v); - } - } - funct[v] = true; - note_implied(token); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("'{a}' is a statement label.", token, v); - } - } - } - } - return this; - }, - led: function () { - error("Expected an operator and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - -// ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim(""); - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - delim("@"); - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (directive["use strict"] && funct["(global)"]) { - warning("Strict violation.", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (directive["use strict"] && !option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("Possible strict violation.", x); - } - }); - reservevar("true"); - reservevar("undefined"); - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("A regular expression literal can be confused with '/='."); - }; - assignop("%=", "assignmod", 20); - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && option.eqeqeq) - warning("Expected '{a}' and instead saw '{b}'.", this, "===", "=="); - else if (isPoorRelation(left)) - warning("Use '{a}' to compare with '{b}'.", this, "===", left.value); - else if (isPoorRelation(right)) - warning("Use '{a}' to compare with '{b}'.", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && option.eqeqeq) { - warning("Expected '{a}' and instead saw '{b}'.", - this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("Use '{a}' to compare with '{b}'.", - this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("Use '{a}' to compare with '{b}'.", - this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!option.scripturl && jx.test(left.value)) { - warning("JavaScript URL.", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("Confusing pluses."); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("Confusing pluses."); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("Confusing minuses."); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("Confusing minuses."); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("Variables should not be deleted."); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (option.bitwise) { - warning("Unexpected '{a}'.", this, "~"); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - if (bang[this.right.id] === true) { - warning("Confusing use of '{a}'.", this, "!"); - } - return this; - }); - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("Do not use {a} as a constructor.", prevtoken, c.value); - break; - case "Function": - if (!option.evil) { - warning("The Function constructor is eval."); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (option.newcap && (i < "A" || i > "Z") && !is_own(global, c.value)) { - warning("A constructor name should start with an uppercase letter.", - token); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("Bad constructor.", token); - } - } - } else { - if (!option.supernew) - warning("Weird construction. Delete 'new'.", this); - } - adjacent(token, nexttoken); - if (nexttoken.id !== "(" && !option.supernew) { - warning("Missing '()' invoking a constructor.", - token, token.value); - } - this.first = c; - return this; - }); - syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(prevtoken, token); - nobreak(); - var m = identifier(); - if (typeof m === "string") { - countMember(m); - } - that.left = left; - that.right = m; - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (option.noarg) - warning("Avoid arguments.{a}.", left, m); - else if (directive["use strict"]) - error("Strict violation."); - } else if (!option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("document.write can be a form of eval.", left); - } - if (!option.evil && (m === "eval" || m === "execScript")) { - warning("eval is evil."); - } - return that; - }, 160, true); - - infix("(", function (left, that) { - if (prevtoken.id !== "}" && prevtoken.id !== ")") { - nobreak(prevtoken, token); - } - nospace(); - if (option.immed && !left.immed && left.id === "function") { - warning("Wrap an immediate function invocation in parentheses " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself."); - } - var n = 0, - p = []; - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("Math is not a function.", left); - } else if (option.newcap) { - warning("Missing 'new' prefix when invoking a constructor.", left); - } - } - } - } - } - if (nexttoken.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (nexttoken.id !== ",") { - break; - } - comma(); - } - } - advance(")"); - nospace(prevtoken, token); - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("Missing radix parameter.", token); - } - if (!option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("eval is evil.", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning( - "Implied eval is evil. Pass a function instead of a string.", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning( - "Implied eval is evil. Pass a function instead of a string.", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("Bad invocation.", left); - } - } - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - nospace(); - if (nexttoken.id === "function") { - nexttoken.immed = true; - } - var v = expression(0); - advance(")", this); - nospace(prevtoken, token); - if (option.immed && v.id === "function") { - if (nexttoken.id !== "(" && - (nexttoken.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning( -"Do not wrap function literals in parens unless they are to be immediately invoked.", - this); - } - } - - return v; - }); - - infix("[", function (left, that) { - nobreak(prevtoken, token); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("eval is evil.", that); - } - countMember(e.value); - if (!option.sub && ix.test(e.value)) { - s = syntax[e.value]; - if (!s || !s.reserved) { - warning("['{a}'] is better written in dot notation.", - prevtoken, e.value); - } - } - } - advance("]", that); - nospace(prevtoken, token); - that.left = left; - that.right = e; - return that; - }, 160, true); - - prefix("[", function () { - var b = token.line !== nexttoken.line; - this.first = []; - if (b) { - indent += option.indent; - if (nexttoken.from === indent + option.indent) { - indent += option.indent; - } - } - while (nexttoken.id !== "(end)") { - while (nexttoken.id === ",") { - if (!option.es5) - warning("Extra comma."); - advance(","); - } - if (nexttoken.id === "]") { - break; - } - if (b && token.line !== nexttoken.line) { - indentation(); - } - this.first.push(expression(10)); - if (nexttoken.id === ",") { - comma(); - if (nexttoken.id === "]" && !option.es5) { - warning("Extra comma.", token); - break; - } - } else { - break; - } - } - if (b) { - indent -= option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(true); - if (!id) { - if (nexttoken.id === "(string)") { - id = nexttoken.value; - advance(); - } else if (nexttoken.id === "(number)") { - id = nexttoken.value.toString(); - advance(); - } - } - return id; - } - - - function functionparams() { - var next = nexttoken; - var params = []; - var ident; - - advance("("); - nospace(); - - if (nexttoken.id === ")") { - advance(")"); - return; - } - - for (;;) { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", token); - if (nexttoken.id === ",") { - comma(); - } else { - advance(")", next); - nospace(prevtoken, token); - return params; - } - } - } - - - function doFunction(name, statement) { - var f; - var oldOption = option; - var oldScope = scope; - - option = Object.create(option); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : nexttoken.line, - "(character)": nexttoken.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(nexttoken), - "(scope)" : scope, - "(statement)": statement, - "(tokens)" : {} - }; - - f = funct; - token.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(); - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, false, true); - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - - scope = oldScope; - option = oldOption; - funct["(last)"] = token.line; - funct["(lastcharacter)"] = token.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (option.maxstatements && - this.statementCount > option.maxstatements) { - var message = "Too many statements per function (" + this.statementCount + ")."; - warning(message, functionStartToken); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (option.maxparams && params.length > option.maxparams) { - var message = "Too many parameters per function (" + params.length + ")."; - warning(message, functionStartToken); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === option.maxdepth + 1) { - var message = "Blocks are nested too deeply (" + this.nestedBlockDepth + ")."; - warning(message); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - var message = "Cyclomatic complexity is too high per function (" + cc + ")."; - warning(message, functionStartToken); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t; - var props = {}; // All properties, including accessors - - function saveProperty(name, token) { - if (props[name] && is_own(props, name)) - warning("Duplicate member '{a}'.", nexttoken, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basicToken = token; - } - - function saveSetter(name, token) { - if (props[name] && is_own(props, name)) { - if (props[name].basic || props[name].setter) - warning("Duplicate member '{a}'.", nexttoken, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = token; - } - - function saveGetter(name) { - if (props[name] && is_own(props, name)) { - if (props[name].basic || props[name].getter) - warning("Duplicate member '{a}'.", nexttoken, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = token; - } - - b = token.line !== nexttoken.line; - if (b) { - indent += option.indent; - if (nexttoken.from === indent + option.indent) { - indent += option.indent; - } - } - for (;;) { - if (nexttoken.id === "}") { - break; - } - if (b) { - indentation(); - } - if (nexttoken.value === "get" && peek().id !== ":") { - advance("get"); - if (!option.es5) { - error("get/set are ES5 features."); - } - i = property_name(); - if (!i) { - error("Missing property name."); - } - saveGetter(i); - t = nexttoken; - adjacent(token, nexttoken); - f = doFunction(); - p = f["(params)"]; - if (p) { - warning("Unexpected parameter '{a}' in get {b} function.", t, p[0], i); - } - adjacent(token, nexttoken); - } else if (nexttoken.value === "set" && peek().id !== ":") { - advance("set"); - if (!option.es5) { - error("get/set are ES5 features."); - } - i = property_name(); - if (!i) { - error("Missing property name."); - } - saveSetter(i, nexttoken); - t = nexttoken; - adjacent(token, nexttoken); - f = doFunction(); - p = f["(params)"]; - if (!p || p.length !== 1) { - warning("Expected a single parameter in set {a} function.", t, i); - } - } else { - i = property_name(); - saveProperty(i, nexttoken); - if (typeof i !== "string") { - break; - } - advance(":"); - nonadjacent(token, nexttoken); - expression(10); - } - - countMember(i); - if (nexttoken.id === ",") { - comma(); - if (nexttoken.id === ",") { - warning("Extra comma.", token); - } else if (nexttoken.id === "}" && !option.es5) { - warning("Extra comma.", token); - } - } else { - break; - } - } - if (b) { - indent -= option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (option.es5) { - for (var name in props) { - if (is_own(props, name) && props[name].setter && !props[name].getter) { - warning("Setter is defined without getter.", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("Expected to see a statement and instead saw a block.", token); - }; - }(delim("{"))); - -// This Function is called when esnext option is set to true -// it adds the `const` statement to JSHINT - - useESNextSyntax = function () { - var conststatement = stmt("const", function (prefix) { - var id, name, value; - - this.first = []; - for (;;) { - nonadjacent(token, nexttoken); - id = identifier(); - if (funct[id] === "const") { - warning("const '" + id + "' has already been declared"); - } - if (funct["(global)"] && predefined[id] === false) { - warning("Redefinition of '{a}'.", token, id); - } - addlabel(id, "const"); - if (prefix) { - break; - } - name = token; - this.first.push(token); - - if (nexttoken.id !== "=") { - warning("const " + - "'{a}' is initialized to 'undefined'.", token, id); - } - - if (nexttoken.id === "=") { - nonadjacent(token, nexttoken); - advance("="); - nonadjacent(token, nexttoken); - if (nexttoken.id === "undefined") { - warning("It is not necessary to initialize " + - "'{a}' to 'undefined'.", token, id); - } - if (peek(0).id === "=" && nexttoken.identifier) { - error("Constant {a} was not declared correctly.", - nexttoken, nexttoken.value); - } - value = expression(0); - name.first = value; - } - - if (nexttoken.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - }; - - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var id, name, value; - - if (funct["(onevar)"] && option.onevar) { - warning("Too many var statements."); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - - for (;;) { - nonadjacent(token, nexttoken); - id = identifier(); - - if (option.esnext && funct[id] === "const") { - warning("const '" + id + "' has already been declared"); - } - - if (funct["(global)"] && predefined[id] === false) { - warning("Redefinition of '{a}'.", token, id); - } - - addlabel(id, "unused", token); - - if (prefix) { - break; - } - - name = token; - this.first.push(token); - - if (nexttoken.id === "=") { - nonadjacent(token, nexttoken); - advance("="); - nonadjacent(token, nexttoken); - if (nexttoken.id === "undefined") { - warning("It is not necessary to initialize '{a}' to 'undefined'.", token, id); - } - if (peek(0).id === "=" && nexttoken.identifier) { - error("Variable {a} was not declared correctly.", - nexttoken, nexttoken.value); - } - value = expression(0); - name.first = value; - } - if (nexttoken.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - - blockstmt("function", function () { - if (inblock) { - warning("Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", token); - - } - var i = identifier(); - if (option.esnext && funct[i] === "const") { - warning("const '" + i + "' has already been declared"); - } - adjacent(token, nexttoken); - addlabel(i, "unction", token); - - doFunction(i, { statement: true }); - if (nexttoken.id === "(" && nexttoken.line === token.line) { - error( -"Function declarations are not invocable. Wrap the whole function invocation in parens."); - } - return this; - }); - - prefix("function", function () { - var i = optionalidentifier(); - if (i) { - adjacent(token, nexttoken); - } else { - nonadjacent(token, nexttoken); - } - doFunction(i); - if (!option.loopfunc && funct["(loopage)"]) { - warning("Don't make functions within a loop."); - } - return this; - }); - - blockstmt("if", function () { - var t = nexttoken; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - advance(")", t); - nospace(prevtoken, token); - block(true, true); - if (nexttoken.id === "else") { - nonadjacent(token, nexttoken); - advance("else"); - if (nexttoken.id === "if" || nexttoken.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(token, nexttoken); - advance("("); - - scope = Object.create(oldScope); - - e = nexttoken.value; - if (nexttoken.type !== "(identifier)") { - e = null; - warning("Expected an identifier and instead saw '{a}'.", nexttoken, e); - } - - advance(); - advance(")"); - - funct = { - "(name)" : "(catch)", - "(line)" : nexttoken.line, - "(character)": nexttoken.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(nexttoken), - "(catch)" : true, - "(tokens)" : {} - }; - - if (e) { - addlabel(e, "exception"); - } - - token.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = token.line; - funct["(lastcharacter)"] = token.character; - funct = funct["(context)"]; - } - - block(false); - - if (nexttoken.id === "catch") { - increaseComplexityCount(); - doCatch(); - b = true; - } - - if (nexttoken.id === "finally") { - advance("finally"); - block(false); - return; - } else if (!b) { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, "catch", nexttoken.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = nexttoken; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - advance(")", t); - nospace(prevtoken, token); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = nexttoken; - if (directive["use strict"]) { - error("'with' is not allowed in strict mode.", token); - } else if (!option.withstmt) { - warning("Don't use 'with'.", token); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(prevtoken, token); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = nexttoken, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(prevtoken, token); - nonadjacent(token, nexttoken); - t = nexttoken; - advance("{"); - nonadjacent(token, nexttoken); - indent += option.indent; - this.cases = []; - for (;;) { - switch (nexttoken.id) { - case "case": - switch (funct["(verb)"]) { - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!ft.test(lines[nexttoken.line - 2])) { - warning( - "Expected a 'break' statement before 'case'.", - token); - } - } - indentation(-option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "break": - case "continue": - case "return": - case "throw": - break; - default: - if (!ft.test(lines[nexttoken.line - 2])) { - warning( - "Expected a 'break' statement before 'default'.", - token); - } - } - indentation(-option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= option.indent; - indentation(); - advance("}", t); - if (this.cases.length === 1 || this.condition.id === "true" || - this.condition.id === "false") { - if (!option.onecase) - warning("This 'switch' should be an 'if'.", this); - } - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("Missing '{a}'.", nexttoken, "}"); - return; - default: - if (g) { - switch (token.id) { - case ",": - error("Each value should have its own case label."); - return; - case ":": - g = false; - statements(); - break; - default: - error("Missing ':' on a case clause.", token); - return; - } - } else { - if (token.id === ":") { - advance(":"); - error("Unexpected '{a}'.", token, ":"); - statements(); - } else { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, "case", nexttoken.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!option.debug) { - warning("All 'debugger' statements should be removed."); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = nexttoken; - nonadjacent(token, t); - advance("("); - nospace(); - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - advance(")", t); - nospace(prevtoken, token); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = nexttoken; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - if (peek(nexttoken.id === "var" ? 1 : 0).id === "in") { - if (nexttoken.id === "var") { - advance("var"); - varstatement.fud.call(varstatement, true); - } else { - switch (funct[nexttoken.value]) { - case "unused": - funct[nexttoken.value] = "var"; - break; - case "var": - break; - default: - warning("Bad for in variable '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - } - advance("in"); - expression(20); - advance(")", t); - s = block(true, true); - if (option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - } else { - if (nexttoken.id !== ";") { - if (nexttoken.id === "var") { - advance("var"); - varstatement.fud.call(varstatement); - } else { - for (;;) { - expression(0, "for"); - if (nexttoken.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(token); - advance(";"); - if (nexttoken.id !== ";") { - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - } - nolinebreak(token); - advance(";"); - if (nexttoken.id === ";") { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, ")", ";"); - } - if (nexttoken.id !== ")") { - for (;;) { - expression(0, "for"); - if (nexttoken.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(prevtoken, token); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - } - }).labelled = true; - - - stmt("break", function () { - var v = nexttoken.value; - - if (funct["(breakage)"] === 0) - warning("Unexpected '{a}'.", nexttoken, this.value); - - if (!option.asi) - nolinebreak(this); - - if (nexttoken.id !== ";") { - if (token.line === nexttoken.line) { - if (funct[v] !== "label") { - warning("'{a}' is not a statement label.", nexttoken, v); - } else if (scope[v] !== funct) { - warning("'{a}' is out of scope.", nexttoken, v); - } - this.first = nexttoken; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = nexttoken.value; - - if (funct["(breakage)"] === 0) - warning("Unexpected '{a}'.", nexttoken, this.value); - - if (!option.asi) - nolinebreak(this); - - if (nexttoken.id !== ";") { - if (token.line === nexttoken.line) { - if (funct[v] !== "label") { - warning("'{a}' is not a statement label.", nexttoken, v); - } else if (scope[v] !== funct) { - warning("'{a}' is out of scope.", nexttoken, v); - } - this.first = nexttoken; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("Unexpected '{a}'.", nexttoken, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === nexttoken.line) { - if (nexttoken.id === "(regexp)") - warning("Wrap the /regexp/ literal in parens to disambiguate the slash operator."); - - if (nexttoken.id !== ";" && !nexttoken.reach) { - nonadjacent(token, nexttoken); - if (peek().value === "=" && !option.boss) { - warningAt("Did you mean to return a conditional instead of an assignment?", - token.line, token.character + 1); - } - this.first = expression(0); - } - } else if (!option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(token, nexttoken); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - -// Superfluous reserved words - - reserve("class"); - reserve("const"); - reserve("enum"); - reserve("export"); - reserve("extends"); - reserve("import"); - reserve("super"); - - reserve("let"); - reserve("yield"); - reserve("implements"); - reserve("interface"); - reserve("package"); - reserve("private"); - reserve("protected"); - reserve("public"); - reserve("static"); - - -// Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = nexttoken; - advance("{"); - if (nexttoken.id !== "}") { - for (;;) { - if (nexttoken.id === "(end)") { - error("Missing '}' to match '{' from line {a}.", - nexttoken, t.line); - } else if (nexttoken.id === "}") { - warning("Unexpected comma.", token); - break; - } else if (nexttoken.id === ",") { - error("Unexpected comma.", nexttoken); - } else if (nexttoken.id !== "(string)") { - warning("Expected a string and instead saw {a}.", - nexttoken, nexttoken.value); - } - if (o[nexttoken.value] === true) { - warning("Duplicate key '{a}'.", - nexttoken, nexttoken.value); - } else if ((nexttoken.value === "__proto__" && - !option.proto) || (nexttoken.value === "__iterator__" && - !option.iterator)) { - warning("The '{a}' key may produce unexpected results.", - nexttoken, nexttoken.value); - } else { - o[nexttoken.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (nexttoken.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = nexttoken; - advance("["); - if (nexttoken.id !== "]") { - for (;;) { - if (nexttoken.id === "(end)") { - error("Missing ']' to match '[' from line {a}.", - nexttoken, t.line); - } else if (nexttoken.id === "]") { - warning("Unexpected comma.", token); - break; - } else if (nexttoken.id === ",") { - error("Unexpected comma.", nexttoken); - } - jsonValue(); - if (nexttoken.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (nexttoken.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (token.character !== nexttoken.from) { - warning("Unexpected space after '-'.", token); - } - adjacent(token, nexttoken); - advance("(number)"); - break; - default: - error("Expected a JSON value.", nexttoken); - } - } - - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(standard); - declared = Object.create(null); - combine(predefined, g || {}); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - a.forEach(function (item) { - var slice; - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - predefined[item] = true; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj.white = true; - } - } - - option = newOptionObj; - - option.indent = option.indent || 4; - option.maxerr = option.maxerr || 50; - - tab = ""; - for (i = 0; i < option.indent; i += 1) { - tab += " "; - } - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(nexttoken) - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - jsonmode = false; - warnings = 0; - lines = []; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("Input is neither a string nor an array of strings.", 0); - return false; - } - - if (isString(s) && /^\s*$/g.test(s)) { - errorAt("Input is an empty string.", 0); - return false; - } - - if (s.length === 0) { - errorAt("Input is an empty array.", 0); - return false; - } - - lex.init(s); - - prereg = true; - directive = {}; - - prevtoken = token = nexttoken = syntax["(begin)"]; - - // Check options - for (var name in o) { - if (is_own(o, name)) { - checkOption(name, token); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - quotmark = undefined; - - try { - advance(); - switch (nexttoken.id) { - case "{": - case "[": - option.laxbreak = true; - jsonmode = true; - jsonValue(); - break; - default: - directives(); - if (directive["use strict"] && !option.globalstrict) { - warning("Use the function form of \"use strict\".", prevtoken); - } - - statements(); - } - advance((nexttoken && nexttoken.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, token) { - var line = token.line; - var chr = token.character; - - if (option.unused) - warningAt("'{a}' is defined but never used.", line, chr, name); - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var token = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - warnUnused(key, token); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - for (var key in func) { - if (is_own(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type; - - while (param) { - type = func[param]; - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type !== "unused" && type !== "unction") - return; - - warnUnused(param, func["(tokens)"][param]); - param = params.pop(); - } - }); - - for (var key in declared) { - if (is_own(declared, key) && !is_own(global, key)) { - warnUnused(key, declared[key]); - } - } - } catch (e) { - if (e) { - var nt = nexttoken || {}; - JSHINT.errors.push({ - raw : e.raw, - reason : e.message, - line : e.line || nt.line, - character : e.character || nt.from - }, null); - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (jsonmode) { - data.json = true; - } - - for (n in implied) { - if (is_own(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/.travis.yml b/node_modules/jsdoc/node_modules/marked/.travis.yml similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/.travis.yml rename to node_modules/jsdoc/node_modules/marked/.travis.yml diff --git a/node_modules/jsdoc/node_modules/marked/LICENSE b/node_modules/jsdoc/node_modules/marked/LICENSE index 11a6189..a7b812e 100644 --- a/node_modules/jsdoc/node_modules/marked/LICENSE +++ b/node_modules/jsdoc/node_modules/marked/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2013, Christopher Jeffrey (https://github.com/chjj/) +Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/jsdoc/node_modules/marked/Makefile b/node_modules/jsdoc/node_modules/marked/Makefile index 7690400..20ac2d4 100644 --- a/node_modules/jsdoc/node_modules/marked/Makefile +++ b/node_modules/jsdoc/node_modules/marked/Makefile @@ -6,4 +6,7 @@ clean: @rm marked.js @rm marked.min.js +bench: + @node test --bench + .PHONY: clean all diff --git a/node_modules/jsdoc/node_modules/marked/README.md b/node_modules/jsdoc/node_modules/marked/README.md index bb8feff..441c1eb 100644 --- a/node_modules/jsdoc/node_modules/marked/README.md +++ b/node_modules/jsdoc/node_modules/marked/README.md @@ -1,46 +1,279 @@ # marked -A full-featured markdown parser and compiler, written in javascript. -Built for speed. +> A full-featured markdown parser and compiler, written in JavaScript. Built +> for speed. -## Benchmarks - -node v0.4.x - -``` bash -$ node test --bench -marked completed in 12071ms. -showdown (reuse converter) completed in 27387ms. -showdown (new converter) completed in 75617ms. -markdown-js completed in 70069ms. -``` - -node v0.6.x - -``` bash -$ node test --bench -marked completed in 6448ms. -marked (gfm) completed in 7357ms. -marked (pedantic) completed in 6092ms. -discount completed in 7314ms. -showdown (reuse converter) completed in 16018ms. -showdown (new converter) completed in 18234ms. -markdown-js completed in 24270ms. -``` - -__Marked is now faster than Discount, which is written in C.__ - -For those feeling skeptical: These benchmarks run the entire markdown test suite -1000 times. The test suite tests every feature. It doesn't cater to specific -aspects. +[![NPM version](https://badge.fury.io/js/marked.png)][badge] ## Install ``` bash -$ npm install marked +npm install marked --save ``` -## Another Javascript Markdown Parser +## Usage + +Minimal usage: + +```js +var marked = require('marked'); +console.log(marked('I am using __markdown__.')); +// Outputs:

            I am using markdown.

            +``` + +Example setting options with default values: + +```js +var marked = require('marked'); +marked.setOptions({ + renderer: new marked.Renderer(), + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: true, + smartLists: true, + smartypants: false +}); + +console.log(marked('I am using __markdown__.')); +``` + +## marked(markdownString [,options] [,callback]) + +### markdownString + +Type: `string` + +String of markdown source to be compiled. + +### options + +Type: `object` + +Hash of options. Can also be set using the `marked.setOptions` method as seen +above. + +### callback + +Type: `function` + +Function called when the `markdownString` has been fully parsed when using +async highlighting. If the `options` argument is omitted, this can be used as +the second argument. + +## Options + +### highlight + +Type: `function` + +A function to highlight code blocks. The first example below uses async highlighting with +[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using +[highlight.js][highlight]: + +```js +var marked = require('marked'); + +var markdownString = '```js\n console.log("hello"); \n```'; + +// Async highlighting with pygmentize-bundled +marked.setOptions({ + highlight: function (code, lang, callback) { + require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { + callback(err, result.toString()); + }); + } +}); + +// Using async version of marked +marked(markdownString, function (err, content) { + if (err) throw err; + console.log(content); +}); + +// Synchronous highlighting with highlight.js +marked.setOptions({ + highlight: function (code) { + return require('highlight.js').highlightAuto(code).value; + } +}); + +console.log(marked(markdownString)); +``` + +#### highlight arguments + +`code` + +Type: `string` + +The section of code to pass to the highlighter. + +`lang` + +Type: `string` + +The programming language specified in the code block. + +`callback` + +Type: `function` + +The callback function to call when using an async highlighter. + +### renderer + +Type: `object` +Default: `new Renderer()` + +An object containing functions to render tokens to HTML. + +#### Overriding renderer methods + +The renderer option allows you to render tokens in a custom manor. Here is an +example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: + +```javascript +var marked = require('marked'); +var renderer = new marked.Renderer(); + +renderer.heading = function (text, level) { + var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); + + return '' + + text + ''; +}, + +console.log(marked('# heading+', { renderer: renderer })); +``` +This code will output the following HTML: +```html +

            + + + + heading+ +

            +``` + +#### Block level renderer methods + +- code(*string* code, *string* language) +- blockquote(*string* quote) +- html(*string* html) +- heading(*string* text, *number* level) +- hr() +- list(*string* body, *boolean* ordered) +- listitem(*string* text) +- paragraph(*string* text) +- table(*string* header, *string* body) +- tablerow(*string* content) +- tablecell(*string* content, *object* flags) + +`flags` has the following properties: + +```js +{ + header: true || false, + align: 'center' || 'left' || 'right' +} +``` + +#### Inline level renderer methods + +- strong(*string* text) +- em(*string* text) +- codespan(*string* code) +- br() +- del(*string* text) +- link(*string* href, *string* title, *string* text) +- image(*string* href, *string* title, *string* text) + +### gfm + +Type: `boolean` +Default: `true` + +Enable [GitHub flavored markdown][gfm]. + +### tables + +Type: `boolean` +Default: `true` + +Enable GFM [tables][tables]. +This option requires the `gfm` option to be true. + +### breaks + +Type: `boolean` +Default: `false` + +Enable GFM [line breaks][breaks]. +This option requires the `gfm` option to be true. + +### pedantic + +Type: `boolean` +Default: `false` + +Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of +the original markdown bugs or poor behavior. + +### sanitize + +Type: `boolean` +Default: `false` + +Sanitize the output. Ignore any HTML that has been input. + +### smartLists + +Type: `boolean` +Default: `true` + +Use smarter list behavior than the original markdown. May eventually be +default with the old behavior moved into `pedantic`. + +### smartypants + +Type: `boolean` +Default: `false` + +Use "smart" typograhic punctuation for things like quotes and dashes. + +## Access to lexer and parser + +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +## CLI + +``` bash +$ marked -o hello.html +hello world +^D +$ cat hello.html +

            hello world

            +``` + +## Philosophy behind marked The point of marked was to create a markdown compiler where it was possible to frequently parse huge chunks of markdown without having to worry about @@ -57,48 +290,30 @@ of performance, but did not in order to be exactly what you expect in terms of a markdown rendering. In fact, this is why marked could be considered at a disadvantage in the benchmarks above. -Along with implementing every markdown feature, marked also implements -[GFM features](http://github.github.com/github-flavored-markdown/). +Along with implementing every markdown feature, marked also implements [GFM +features][gfmf]. -## Options +## Benchmarks -marked has a few different switches which change behavior. +node v0.8.x -- __pedantic__: Conform to obscure parts of `markdown.pl` as much as possible. - Don't fix any of the original markdown bugs or poor behavior. -- __gfm__: Enable github flavored markdown (enabled by default). -- __sanitize__: Sanitize the output. Ignore any HTML that has been input. -- __highlight__: A callback to highlight code blocks. -- __tables__: Enable GFM tables. This is enabled by default. (Requires the - `gfm` option in order to be enabled). -- __breaks__: Enable GFM line breaks. Disabled by default. -- __smartLists__: Use smarter list behavior than the original markdown. - Disabled by default. May eventually be default with the old behavior - moved into `pedantic`. -- __langPrefix__: Set the prefix for code block classes. Defaults to `lang-`. - -## Usage - -``` js -// Set default options -marked.setOptions({ - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: true, - smartLists: true, - langPrefix: 'language-', - highlight: function(code, lang) { - if (lang === 'js') { - return highlighter.javascript(code); - } - return code; - } -}); -console.log(marked('i am using __markdown__.')); +``` bash +$ node test --bench +marked completed in 3411ms. +marked (gfm) completed in 3727ms. +marked (pedantic) completed in 3201ms. +robotskirt completed in 808ms. +showdown (reuse converter) completed in 11954ms. +showdown (new converter) completed in 17774ms. +markdown-js completed in 17191ms. ``` +__Marked is now faster than Discount, which is written in C.__ + +For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. + +### Pro level + You also have direct access to the lexer and parser if you so desire. ``` js @@ -123,18 +338,49 @@ $ node links: {} ] ``` -## CLI +## Running Tests & Contributing + +If you want to submit a pull request, make sure your changes pass the test +suite. If you're adding a new feature, be sure to add your own test. + +The marked test suite is set up slightly strangely: `test/new` is for all tests +that are not part of the original markdown.pl test suite (this is where your +test should go if you make one). `test/original` is only for the original +markdown.pl tests. `test/tests` houses both types of tests after they have been +combined and moved/generated by running `node test --fix` or `marked --test +--fix`. + +In other words, if you have a test to add, add it to `test/new/` and then +regenerate the tests with `node test --fix`. Commit the result. If your test +uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you +can add `.nogfm` to the filename. So, `my-test.text` becomes +`my-test.nogfm.text`. You can do this with any marked option. Say you want +line breaks and smartypants enabled, your filename should be: +`my-test.breaks.smartypants.text`. + +To run the tests: ``` bash -$ marked -o hello.html -hello world -^D -$ cat hello.html -

            hello world

            +cd marked/ +node test ``` +### Contribution and License Agreement + +If you contribute code to this project, you are implicitly allowing your code +to be distributed under the MIT license. You are also implicitly verifying that +all code is your original work. `` + ## License -Copyright (c) 2011-2013, Christopher Jeffrey. (MIT License) +Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) See LICENSE for more info. + +[gfm]: https://help.github.com/articles/github-flavored-markdown +[gfmf]: http://github.github.com/github-flavored-markdown/ +[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled +[highlight]: https://github.com/isagalaev/highlight.js +[badge]: http://badge.fury.io/js/marked +[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables +[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/node_modules/jsdoc/node_modules/marked/bin/marked b/node_modules/jsdoc/node_modules/marked/bin/marked index 90a0fa9..64254fc 100755 --- a/node_modules/jsdoc/node_modules/marked/bin/marked +++ b/node_modules/jsdoc/node_modules/marked/bin/marked @@ -72,6 +72,8 @@ function main(argv, callback) { while (argv.length) { arg = getarg(); switch (arg) { + case '--test': + return require('../test').main(process.argv.slice()); case '-o': case '--output': output = argv.shift(); diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/component.json b/node_modules/jsdoc/node_modules/marked/component.json similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/component.json rename to node_modules/jsdoc/node_modules/marked/component.json diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/doc/broken.md b/node_modules/jsdoc/node_modules/marked/doc/broken.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/doc/broken.md rename to node_modules/jsdoc/node_modules/marked/doc/broken.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/doc/todo.md b/node_modules/jsdoc/node_modules/marked/doc/todo.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/marked/doc/todo.md rename to node_modules/jsdoc/node_modules/marked/doc/todo.md diff --git a/node_modules/jsdoc/node_modules/marked/lib/marked.js b/node_modules/jsdoc/node_modules/marked/lib/marked.js index 1b76ab0..e2f08c9 100644 --- a/node_modules/jsdoc/node_modules/marked/lib/marked.js +++ b/node_modules/jsdoc/node_modules/marked/lib/marked.js @@ -1,6 +1,6 @@ /** * marked - a markdown parser - * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed) + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ @@ -17,9 +17,9 @@ var block = { hr: /^( *[-*_]){3,} *(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, nptable: noop, - lheading: /^([^\n]+)\n *(=|-){3,} *\n*/, - blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/, - list: /^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + 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, @@ -35,13 +35,18 @@ block.item = replace(block.item, 'gm') block.list = replace(block.list) (/bull/g, block.bullet) - ('hr', /\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/) + ('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+(?!:/|@)\\b'; + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; block.html = replace(block.html) ('comment', //) @@ -70,12 +75,14 @@ block.normal = merge({}, block); */ block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,}) *(\w+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, + 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.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') (); /** @@ -139,7 +146,7 @@ Lexer.prototype.lex = function(src) { * Lexing */ -Lexer.prototype.token = function(src, top) { +Lexer.prototype.token = function(src, top, bq) { var src = src.replace(/^ +$/gm, '') , next , loose @@ -262,7 +269,7 @@ Lexer.prototype.token = function(src, top) { // Pass `top` to keep the current // "toplevel" state. This is exactly // how markdown.pl works. - this.token(cap, top); + this.token(cap, top, true); this.tokens.push({ type: 'blockquote_end' @@ -274,20 +281,16 @@ Lexer.prototype.token = function(src, top) { // list if (cap = this.rules.list.exec(src)) { src = src.substring(cap[0].length); + bull = cap[2]; this.tokens.push({ type: 'list_start', - ordered: isFinite(cap[2]) + ordered: bull.length > 1 }); // Get each top-level item. cap = cap[0].match(this.rules.item); - // Get bullet. - if (this.options.smartLists) { - bull = block.bullet.exec(cap[0])[0]; - } - next = false; l = cap.length; i = 0; @@ -312,8 +315,8 @@ Lexer.prototype.token = function(src, top) { // Determine whether the next list item belongs here. // Backpedal if it does not belong in this list. if (this.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i+1])[0]; - if (bull !== b && !(bull[1] === '.' && b[1] === '.')) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { src = cap.slice(i + 1).join('\n') + src; i = l - 1; } @@ -324,7 +327,7 @@ Lexer.prototype.token = function(src, top) { // for discount behavior. loose = next || /\n\n(?!\s*$)/.test(item); if (i !== l - 1) { - next = item[item.length-1] === '\n'; + next = item.charAt(item.length - 1) === '\n'; if (!loose) loose = next; } @@ -335,7 +338,7 @@ Lexer.prototype.token = function(src, top) { }); // Recurse. - this.token(item, false); + this.token(item, false, bq); this.tokens.push({ type: 'list_item_end' @@ -356,14 +359,14 @@ Lexer.prototype.token = function(src, top) { type: this.options.sanitize ? 'paragraph' : 'html', - pre: cap[1] === 'pre', + pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', text: cap[0] }); continue; } // def - if (top && (cap = this.rules.def.exec(src))) { + if ((!bq && top) && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); this.tokens.links[cap[1].toLowerCase()] = { href: cap[2], @@ -411,7 +414,7 @@ Lexer.prototype.token = function(src, top) { src = src.substring(cap[0].length); this.tokens.push({ type: 'paragraph', - text: cap[1][cap[1].length-1] === '\n' + text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1] }); @@ -458,8 +461,8 @@ var inline = { text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; +inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/; +inline._href = /\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/; inline.link = replace(inline.link) ('inside', inline._inside) @@ -516,6 +519,8 @@ 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 @@ -571,7 +576,7 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.autolink.exec(src)) { src = src.substring(cap[0].length); if (cap[2] === '@') { - text = cap[1][6] === ':' + text = cap[1].charAt(6) === ':' ? this.mangle(cap[1].substring(7)) : this.mangle(cap[1]); href = this.mangle('mailto:') + text; @@ -579,29 +584,26 @@ InlineLexer.prototype.output = function(src) { text = escape(cap[1]); href = text; } - out += '' - + text - + ''; + out += this.renderer.link(href, null, text); continue; } // url (gfm) - if (cap = this.rules.url.exec(src)) { + if (!this.inLink && (cap = this.rules.url.exec(src))) { src = src.substring(cap[0].length); text = escape(cap[1]); href = text; - out += '' - + text - + ''; + out += this.renderer.link(href, null, text); continue; } // tag 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]) @@ -612,10 +614,12 @@ InlineLexer.prototype.output = function(src) { // link 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; } @@ -626,61 +630,55 @@ InlineLexer.prototype.output = function(src) { link = (cap[2] || cap[1]).replace(/\s+/g, ' '); link = this.links[link.toLowerCase()]; if (!link || !link.href) { - out += cap[0][0]; + out += cap[0].charAt(0); src = cap[0].substring(1) + src; continue; } + this.inLink = true; out += this.outputLink(cap, link); + this.inLink = false; continue; } // strong if (cap = this.rules.strong.exec(src)) { src = src.substring(cap[0].length); - out += '' - + this.output(cap[2] || cap[1]) - + ''; + out += this.renderer.strong(this.output(cap[2] || cap[1])); continue; } // em if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); - out += '' - + this.output(cap[2] || cap[1]) - + ''; + out += this.renderer.em(this.output(cap[2] || cap[1])); continue; } // code if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); - out += '' - + escape(cap[2], true) - + ''; + out += this.renderer.codespan(escape(cap[2], true)); continue; } // br if (cap = this.rules.br.exec(src)) { src = src.substring(cap[0].length); - out += '
            '; + out += this.renderer.br(); continue; } // del (gfm) if (cap = this.rules.del.exec(src)) { src = src.substring(cap[0].length); - out += '' - + this.output(cap[1]) - + ''; + out += this.renderer.del(this.output(cap[1])); continue; } // text if (cap = this.rules.text.exec(src)) { src = src.substring(cap[0].length); - out += escape(cap[0]); + out += escape(this.smartypants(cap[0])); continue; } @@ -698,31 +696,33 @@ InlineLexer.prototype.output = function(src) { */ InlineLexer.prototype.outputLink = function(cap, link) { - if (cap[0][0] !== '!') { - return '
            ' - + this.output(cap[1]) - + ''; - } else { - return ''
-      + escape(cap[1])
-      + ''; - } + 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])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/--/g, '\u2014') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); }; /** @@ -746,6 +746,149 @@ InlineLexer.prototype.mangle = function(text) { return out; }; +/** + * Renderer + */ + +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'; +}; + +// span level renderer +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; +}; + /** * Parsing & Compiling */ @@ -754,14 +897,17 @@ 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; } /** * Static Parse Method */ -Parser.parse = function(src, options) { - var parser = new Parser(options); +Parser.parse = function(src, options, renderer) { + var parser = new Parser(options, renderer); return parser.parse(src); }; @@ -770,7 +916,7 @@ Parser.parse = function(src, options) { */ Parser.prototype.parse = function(src) { - this.inline = new InlineLexer(src.links, this.options); + this.inline = new InlineLexer(src.links, this.options, this.renderer); this.tokens = src.reverse(); var out = ''; @@ -794,7 +940,7 @@ Parser.prototype.next = function() { */ Parser.prototype.peek = function() { - return this.tokens[this.tokens.length-1] || 0; + return this.tokens[this.tokens.length - 1] || 0; }; /** @@ -821,77 +967,53 @@ Parser.prototype.tok = function() { return ''; } case 'hr': { - return '
            \n'; + return this.renderer.hr(); } case 'heading': { - return '' - + this.inline.output(this.token.text) - + '\n'; + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + this.token.text); } case 'code': { - if (this.options.highlight) { - var code = this.options.highlight(this.token.text, this.token.lang); - if (code != null && code !== this.token.text) { - this.token.escaped = true; - this.token.text = code; - } - } - - if (!this.token.escaped) { - this.token.text = escape(this.token.text, true); - } - - return '
            '
            -        + this.token.text
            -        + '
            \n'; + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); } case 'table': { - var body = '' - , heading + var header = '' + , body = '' , i , row , cell + , flags , j; // header - body += '\n\n'; + cell = ''; for (i = 0; i < this.token.header.length; i++) { - heading = this.inline.output(this.token.header[i]); - body += this.token.align[i] - ? '' + heading + '\n' - : '' + heading + '\n'; + flags = { header: true, align: this.token.align[i] }; + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); } - body += '\n\n'; + header += this.renderer.tablerow(cell); - // body - body += '\n' for (i = 0; i < this.token.cells.length; i++) { row = this.token.cells[i]; - body += '\n'; - for (j = 0; j < row.length; j++) { - cell = this.inline.output(row[j]); - body += this.token.align[j] - ? '' + cell + '\n' - : '' + cell + '\n'; - } - body += '\n'; - } - body += '\n'; - return '\n' - + body - + '
            \n'; + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); } case 'blockquote_start': { var body = ''; @@ -900,25 +1022,17 @@ Parser.prototype.tok = function() { body += this.tok(); } - return '
            \n' - + body - + '
            \n'; + return this.renderer.blockquote(body); } case 'list_start': { - var type = this.token.ordered ? 'ol' : 'ul' - , body = ''; + var body = '' + , ordered = this.token.ordered; while (this.next().type !== 'list_end') { body += this.tok(); } - return '<' - + type - + '>\n' - + body - + '\n'; + return this.renderer.list(body, ordered); } case 'list_item_start': { var body = ''; @@ -929,9 +1043,7 @@ Parser.prototype.tok = function() { : this.tok(); } - return '
          3. ' - + body - + '
          4. \n'; + return this.renderer.listitem(body); } case 'loose_item_start': { var body = ''; @@ -940,24 +1052,19 @@ Parser.prototype.tok = function() { body += this.tok(); } - return '
          5. ' - + body - + '
          6. \n'; + return this.renderer.listitem(body); } case 'html': { - return !this.token.pre && !this.options.pedantic + var html = !this.token.pre && !this.options.pedantic ? this.inline.output(this.token.text) : this.token.text; + return this.renderer.html(html); } case 'paragraph': { - return '

            ' - + this.inline.output(this.token.text) - + '

            \n'; + return this.renderer.paragraph(this.inline.output(this.token.text)); } case 'text': { - return '

            ' - + this.parseText() - + '

            \n'; + return this.renderer.paragraph(this.parseText()); } } }; @@ -975,6 +1082,19 @@ function escape(html, encode) { .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 || ''; @@ -1007,11 +1127,75 @@ function merge(obj) { return obj; } + /** * Marked */ -function marked(src, opt) { +function marked(src, opt, callback) { + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight + , tokens + , pending + , i = 0; + + try { + tokens = Lexer.lex(src, opt) + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function() { + var out, err; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } try { if (opt) opt = merge({}, marked.defaults, opt); return Parser.parse(Lexer.lex(src, opt), opt); @@ -1045,7 +1229,11 @@ marked.defaults = { smartLists: false, silent: false, highlight: null, - langPrefix: 'lang-' + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false }; /** @@ -1055,6 +1243,8 @@ marked.defaults = { marked.Parser = Parser; marked.parser = Parser.parse; +marked.Renderer = Renderer; + marked.Lexer = Lexer; marked.lexer = Lexer.lex; diff --git a/node_modules/jsdoc/node_modules/marked/man/marked.1 b/node_modules/jsdoc/node_modules/marked/man/marked.1 index b10d381..f89f1a7 100644 --- a/node_modules/jsdoc/node_modules/marked/man/marked.1 +++ b/node_modules/jsdoc/node_modules/marked/man/marked.1 @@ -1,5 +1,5 @@ .ds q \N'34' -.TH marked 1 "2013-01-05" "v0.2.7" "marked.js" +.TH marked 1 "2014-01-31" "v0.3.1" "marked.js" .SH NAME marked \- a javascript markdown parser @@ -23,9 +23,9 @@ cat in.md | marked > out.html .TP echo "hello *world*" | marked .TP -marked -o out.html in.md --gfm +marked \-o out.html in.md \-\-gfm .TP -marked --output="hello world.html" -i in.md --no-breaks +marked \-\-output="hello world.html" \-i in.md \-\-no-breaks .SH OPTIONS .TP @@ -81,7 +81,7 @@ For configuring and running programmatically. Please report any bugs to https://github.com/chjj/marked. .SH LICENSE -Copyright (c) 2011-2013, Christopher Jeffrey (MIT License). +Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). .SH "SEE ALSO" .BR markdown(1), diff --git a/node_modules/jsdoc/node_modules/marked/package.json b/node_modules/jsdoc/node_modules/marked/package.json index b386a88..e225de6 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.2.8", + "version": "0.3.2", "main": "./lib/marked.js", "bin": { "marked": "./bin/marked" @@ -21,6 +21,7 @@ "bugs": { "url": "http://github.com/chjj/marked/issues" }, + "license": "MIT", "keywords": [ "markdown", "markup", @@ -31,17 +32,22 @@ "markup", "html" ], + "devDependencies": { + "markdown": "*", + "showdown": "*", + "robotskirt": "*" + }, "scripts": { "test": "node test", "bench": "node test --bench" }, - "_id": "marked@0.2.8", + "_id": "marked@0.3.2", "dist": { - "shasum": "dddbcc38ed8182b680aaf9d7cebbe7b624976071", - "tarball": "http://registry.npmjs.org/marked/-/marked-0.2.8.tgz" + "shasum": "015db158864438f24a64bdd61a0428b418706d09", + "tarball": "http://registry.npmjs.org/marked/-/marked-0.3.2.tgz" }, - "_from": "marked@0.2.8", - "_npmVersion": "1.2.2", + "_from": "marked@>=0.3.1 <0.4.0", + "_npmVersion": "1.4.3", "_npmUser": { "name": "chjj", "email": "chjjeffrey@gmail.com" @@ -53,6 +59,7 @@ } ], "directories": {}, - "_shasum": "dddbcc38ed8182b680aaf9d7cebbe7b624976071", - "_resolved": "https://registry.npmjs.org/marked/-/marked-0.2.8.tgz" + "_shasum": "015db158864438f24a64bdd61a0428b418706d09", + "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/LICENSE b/node_modules/jsdoc/node_modules/requizzle/LICENSE similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/LICENSE rename to node_modules/jsdoc/node_modules/requizzle/LICENSE diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/README.md b/node_modules/jsdoc/node_modules/requizzle/README.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/README.md rename to node_modules/jsdoc/node_modules/requizzle/README.md diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/index.js b/node_modules/jsdoc/node_modules/requizzle/index.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/index.js rename to node_modules/jsdoc/node_modules/requizzle/index.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/loader.js b/node_modules/jsdoc/node_modules/requizzle/lib/loader.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/loader.js rename to node_modules/jsdoc/node_modules/requizzle/lib/loader.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js b/node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js rename to node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/extras.js b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/extras.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/extras.js rename to node_modules/jsdoc/node_modules/requizzle/lib/wrappers/extras.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js rename to node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/strict.js b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/strict.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/strict.js rename to node_modules/jsdoc/node_modules/requizzle/lib/wrappers/strict.js diff --git a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/LICENSE b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE similarity index 91% rename from node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/LICENSE rename to node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE index 05a4010..0d6b873 100644 --- a/node_modules/jsdoc/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/LICENSE +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE @@ -1,5 +1,5 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +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 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..7b38533 --- /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" +} 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/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/package.json b/node_modules/jsdoc/node_modules/requizzle/package.json similarity index 96% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/package.json rename to node_modules/jsdoc/node_modules/requizzle/package.json index 1ebcebf..cc3d9ac 100644 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/requizzle/package.json +++ b/node_modules/jsdoc/node_modules/requizzle/package.json @@ -58,5 +58,6 @@ "tarball": "http://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz" + "_resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/cli.js b/node_modules/jsdoc/node_modules/strip-json-comments/cli.js similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/cli.js rename to node_modules/jsdoc/node_modules/strip-json-comments/cli.js diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/package.json b/node_modules/jsdoc/node_modules/strip-json-comments/package.json similarity index 93% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/package.json rename to node_modules/jsdoc/node_modules/strip-json-comments/package.json index 9deead3..ec1cecd 100644 --- a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/package.json +++ b/node_modules/jsdoc/node_modules/strip-json-comments/package.json @@ -55,7 +55,7 @@ "homepage": "https://github.com/sindresorhus/strip-json-comments", "_id": "strip-json-comments@0.1.3", "_shasum": "164c64e370a8a3cc00c9e01b539e569823f0ee54", - "_from": "strip-json-comments@>=0.1.3 <0.2.0", + "_from": "strip-json-comments@0.1.3", "_npmVersion": "1.4.13", "_npmUser": { "name": "sindresorhus", @@ -72,5 +72,6 @@ "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.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-0.1.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/readme.md b/node_modules/jsdoc/node_modules/strip-json-comments/readme.md similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/readme.md rename to node_modules/jsdoc/node_modules/strip-json-comments/readme.md diff --git a/node_modules/grunt-jsdoc/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 similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js rename to node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js diff --git a/node_modules/jsdoc/node_modules/taffydb/package.json b/node_modules/jsdoc/node_modules/taffydb/package.json index 1760de2..1165f20 100644 --- a/node_modules/jsdoc/node_modules/taffydb/package.json +++ b/node_modules/jsdoc/node_modules/taffydb/package.json @@ -15,7 +15,7 @@ }, "homepage": "https://github.com/hegemonic/taffydb", "_id": "taffydb@2.6.2", - "_shasum": "0c63e695048d51f7dfa6bdbc0231c93e2173d0a4", - "_resolved": "git+https://github.com/hegemonic/taffydb.git#7d100bcee0e997ee4977e273cdce60bd8933050e", - "_from": "taffydb@git+https://github.com/hegemonic/taffydb.git" + "_shasum": "3c549d2f5712d7d1d109ad6bb1a4084f1b7add4e", + "_from": "https://github.com/hegemonic/taffydb/tarball/master", + "_resolved": "https://github.com/hegemonic/taffydb/tarball/master" } diff --git a/node_modules/jsdoc/node_modules/underscore/.npmignore b/node_modules/jsdoc/node_modules/underscore/.npmignore deleted file mode 100644 index 2ce2684..0000000 --- a/node_modules/jsdoc/node_modules/underscore/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test/ -Rakefile -docs/ \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/underscore/CNAME b/node_modules/jsdoc/node_modules/underscore/CNAME deleted file mode 100644 index a007e65..0000000 --- a/node_modules/jsdoc/node_modules/underscore/CNAME +++ /dev/null @@ -1 +0,0 @@ -underscorejs.org diff --git a/node_modules/jsdoc/node_modules/underscore/CONTRIBUTING.md b/node_modules/jsdoc/node_modules/underscore/CONTRIBUTING.md deleted file mode 100644 index 36a9934..0000000 --- a/node_modules/jsdoc/node_modules/underscore/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to contribute to Underscore.js - -* Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. - -* Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/test.html). - -* Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). - -* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/underscore/LICENSE b/node_modules/jsdoc/node_modules/underscore/LICENSE index 61d28c0..0d6b873 100644 --- a/node_modules/jsdoc/node_modules/underscore/LICENSE +++ b/node_modules/jsdoc/node_modules/underscore/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud +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 @@ -19,4 +20,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 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 +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/underscore/README.md b/node_modules/jsdoc/node_modules/underscore/README.md index b1f3e50..c2ba259 100644 --- a/node_modules/jsdoc/node_modules/underscore/README.md +++ b/node_modules/jsdoc/node_modules/underscore/README.md @@ -15,5 +15,8 @@ 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/documentcloud/underscore/contributors +https://github.com/jashkenas/underscore/contributors diff --git a/node_modules/jsdoc/node_modules/underscore/favicon.ico b/node_modules/jsdoc/node_modules/underscore/favicon.ico deleted file mode 100644 index 0304968..0000000 Binary files a/node_modules/jsdoc/node_modules/underscore/favicon.ico and /dev/null differ diff --git a/node_modules/jsdoc/node_modules/underscore/index.html b/node_modules/jsdoc/node_modules/underscore/index.html deleted file mode 100644 index 71b1f5a..0000000 --- a/node_modules/jsdoc/node_modules/underscore/index.html +++ /dev/null @@ -1,2367 +0,0 @@ - - - - - - - - - Underscore.js - - - - -
            - -
            - -

            - -

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

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

            Collection Functions (Arrays or Objects)

            - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Array Functions

            - -

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

            - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Function (uh, ahem) Functions

            - -

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

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

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

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

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

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

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

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

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

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

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

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

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

            - -

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

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

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

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

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

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

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

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

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

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

            Object Functions

            - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Utility Functions

            - -

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

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

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

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

            - times_.times(n, iterator, [context]) -
            - Invokes the given iterator function n times. Each invocation of - iterator is called with an index argument. -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Chaining

            - -

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

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

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

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

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

            - -

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

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

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

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

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

            - Ruby's Enumerable module. -

            - -

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

            - -

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

            - -

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

            - -

            - Python's itertools. -

            - -

            Change Log

            - -

            - 1.4.2Oct. 1, 2012Diff
            -

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

            - -

            - 1.4.1Oct. 1, 2012Diff
            -

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

            - -

            - 1.4.0Sept. 27, 2012Diff
            -

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

            - -

            - 1.3.3April 10, 2012
            -

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

            - -

            - 1.3.1Jan. 23, 2012
            -

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

            - -

            - 1.3.0Jan. 11, 2012
            -

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

            - -

            - 1.2.4Jan. 4, 2012
            -

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

            - -

            - 1.2.3Dec. 7, 2011
            -

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

            - -

            - 1.2.2Nov. 14, 2011
            -

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

            - -

            - 1.2.1Oct. 24, 2011
            -

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

            - -

            - 1.2.0Oct. 5, 2011
            -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

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

            - -

            - 0.1.0
            - Initial release of Underscore.js. -

            - -

            - - A DocumentCloud Project - -

            - -
            - -
            - - - - - - diff --git a/node_modules/jsdoc/node_modules/underscore/index.js b/node_modules/jsdoc/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/jsdoc/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/jsdoc/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/underscore/package.json index ce2f7f6..7b38533 100644 --- a/node_modules/jsdoc/node_modules/underscore/package.json +++ b/node_modules/jsdoc/node_modules/underscore/package.json @@ -15,28 +15,36 @@ }, "repository": { "type": "git", - "url": "git://github.com/documentcloud/underscore.git" + "url": "git://github.com/jashkenas/underscore.git" }, "main": "underscore.js", - "version": "1.4.2", - "_id": "underscore@1.4.2", - "dist": { - "shasum": "cb2aae6a7999a89fd55aaee75bce0311698cebfb", - "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.4.2.tgz" + "version": "1.6.0", + "devDependencies": { + "docco": "0.6.x", + "phantomjs": "1.9.0-1", + "uglify-js": "2.4.x" }, - "_npmVersion": "1.1.49", - "_npmUser": { - "name": "jashkenas", - "email": "jashkenas@gmail.com" + "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" }, - "maintainers": [ + "licenses": [ { - "name": "jashkenas", - "email": "jashkenas@gmail.com" + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" } ], - "directories": {}, - "_shasum": "cb2aae6a7999a89fd55aaee75bce0311698cebfb", - "_from": "underscore@1.4.2", - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.2.tgz" + "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/underscore/raw/underscore.psd b/node_modules/jsdoc/node_modules/underscore/raw/underscore.psd deleted file mode 100644 index 73ad2d7..0000000 Binary files a/node_modules/jsdoc/node_modules/underscore/raw/underscore.psd and /dev/null differ diff --git a/node_modules/jsdoc/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/underscore/underscore-min.js index ad3a39a..3434d6c 100644 --- a/node_modules/jsdoc/node_modules/underscore/underscore-min.js +++ b/node_modules/jsdoc/node_modules/underscore/underscore-min.js @@ -1,5 +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(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=r.unshift,l=i.toString,c=i.hasOwnProperty,h=r.forEach,p=r.map,d=r.reduce,v=r.reduceRight,m=r.filter,g=r.every,y=r.some,b=r.indexOf,w=r.lastIndexOf,E=Array.isArray,S=Object.keys,x=s.bind,T=function(e){if(e instanceof T)return e;if(!(this instanceof T))return new T(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.4.2";var N=T.each=T.forEach=function(e,t,r){if(e==null)return;if(h&&e.forEach===h)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;e==null&&(e=[]);if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return e==null?r:m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return e==null?r:(N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r)},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return e==null?i:g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return e==null?i:y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return e==null?n:b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r":">",'"':""","'":"'","/":"/"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file +(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/underscore/underscore.js b/node_modules/jsdoc/node_modules/underscore/underscore.js index 1ebe267..9a4cabe 100644 --- a/node_modules/jsdoc/node_modules/underscore/underscore.js +++ b/node_modules/jsdoc/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,36 +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) { - var results = []; - if (obj == null) return results; - each(obj, function(value, index, list) { - if (!iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; + _.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, 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; }; @@ -202,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; }; @@ -216,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). @@ -271,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; @@ -293,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; @@ -314,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) { @@ -360,15 +379,17 @@ 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); }; // 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; }; @@ -379,7 +400,10 @@ // 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) { - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + 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 @@ -393,11 +417,9 @@ // 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 ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } + 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`. @@ -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; }; @@ -491,8 +530,9 @@ // pairs, or two parallel arrays of the same length -- one of keys, and one of // the corresponding values. _.object = function(list, values) { + if (list == null) return {}; var result = {}; - for (var i = 0, l = list.length; i < l; i++) { + for (var i = 0, length = list.length; i < length; i++) { if (values) { result[list[i]] = values[i]; } else { @@ -510,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; }; @@ -546,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; } @@ -565,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; }; @@ -616,27 +673,36 @@ }; // 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, throttling, more, result; - var whenDone = _.debounce(function(){ more = throttling = false; }, wait); + // 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() { - context = this; args = arguments; - var later = 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; - if (more) { - result = func.apply(context, args); - } - whenDone(); - }; - if (!timeout) timeout = setTimeout(later, wait); - if (throttling) { - more = true; - } else { - throttling = true; + previous = now; result = func.apply(context, args); + context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); } - whenDone(); return result; }; }; @@ -646,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; }; }; @@ -678,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 @@ -700,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); @@ -713,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; }; @@ -754,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; @@ -784,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; @@ -808,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; @@ -850,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); @@ -866,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)) { @@ -950,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). @@ -994,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). @@ -1005,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: { @@ -1015,8 +1139,7 @@ '<': '<', '>': '>', '"': '"', - "'": ''', - '/': '/' + "'": ''' } }; entityMap.unescape = _.invert(entityMap.escape); @@ -1037,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]; @@ -1061,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; }; @@ -1096,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. @@ -1111,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"; @@ -1127,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; @@ -1197,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/wrench/package.json b/node_modules/jsdoc/node_modules/wrench/package.json index 00daee7..d12c7de 100644 --- a/node_modules/jsdoc/node_modules/wrench/package.json +++ b/node_modules/jsdoc/node_modules/wrench/package.json @@ -55,5 +55,7 @@ ], "_shasum": "6f13ec35145317eb292ca5f6531391b244111411", "_from": "wrench@1.3.9", - "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz" + "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/ryanmcgrath/wrench-js" } diff --git a/node_modules/jsdoc/nodejs/bin/jsdoc b/node_modules/jsdoc/nodejs/bin/jsdoc deleted file mode 100755 index c53efc4..0000000 --- a/node_modules/jsdoc/nodejs/bin/jsdoc +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node - -// This wrapper script allows JSDoc to be installed with 'npm install -g'. -// Note that JSDoc will still run on Mozilla Rhino, NOT Node.js. - - -var fs = require('fs'); -var os = require('os'); -var path = require('path'); -var spawnProc = require('child_process').spawn; - -var args = process.argv.slice(2); -var script = path.normalize( path.join( path.dirname(fs.realpathSync(process.argv[1])), '..', '..', - 'jsdoc' ) ); -var jsdoc; - -if (process.platform === 'win32') { - jsdoc = spawnProc(script + '.cmd', args, {stdio: 'inherit'}); -} -else { - jsdoc = spawnProc(script, args, {stdio: 'inherit'}); -} - -jsdoc.on('close', function(code) { - process.exit(code); -}); diff --git a/node_modules/jsdoc/nodejs/jsdoc/fs.js b/node_modules/jsdoc/nodejs/jsdoc/fs.js deleted file mode 100644 index 7115ff0..0000000 --- a/node_modules/jsdoc/nodejs/jsdoc/fs.js +++ /dev/null @@ -1,17 +0,0 @@ -var e = ' is not implemented for Node.js!'; - -exports.ls = function() { - throw new Error('fs.ls' + e); -}; - -exports.toDir = function() { - throw new Error('fs.toDir' + e); -}; - -exports.mkPath = function() { - throw new Error('fs.mkpath' + e); -}; - -exports.copyFileSync = function() { - throw new Error('fs.copyFileSync' + e); -}; diff --git a/node_modules/jsdoc/nodejs/jsdoc/util/include.js b/node_modules/jsdoc/nodejs/jsdoc/util/include.js deleted file mode 100644 index c5c0d4d..0000000 --- a/node_modules/jsdoc/nodejs/jsdoc/util/include.js +++ /dev/null @@ -1,8 +0,0 @@ -// TODO: not tested -module.exports = function(filepath) { - var fs = require('jsdoc/fs'); - var vm = require('vm'); - - var script = fs.readFileSync(filepath, 'utf8'); - vm.runInNewContext(script, global, filepath); -}; diff --git a/node_modules/jsdoc/package.json b/node_modules/jsdoc/package.json index f825e35..8f4c100 100644 --- a/node_modules/jsdoc/package.json +++ b/node_modules/jsdoc/package.json @@ -1,7 +1,7 @@ { "name": "jsdoc", - "version": "3.2.2", - "revision": "1383581570249", + "version": "3.3.0-alpha9", + "revision": "1403969163513", "description": "An API documentation generator for JavaScript.", "keywords": [ "documentation", @@ -18,18 +18,32 @@ "url": "https://github.com/jsdoc3/jsdoc" }, "dependencies": { - "async": "0.1.22", - "catharsis": "0.7.0", - "crypto-browserify": "git+https://github.com/dominictarr/crypto-browserify.git#95c5d505", - "js2xmlparser": "0.1.0", - "jshint": "0.9.1", - "marked": "0.2.8", - "taffydb": "git+https://github.com/hegemonic/taffydb.git", - "underscore": "1.4.2", - "wrench": "1.3.9" + "async": "~0.1.22", + "catharsis": "~0.8.2", + "esprima": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", + "js2xmlparser": "~0.1.0", + "marked": "~0.3.1", + "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" + }, + "devDependencies": { + "gulp": "~3.6.2", + "gulp-eslint": "~0.1.6", + "gulp-json-editor": "~2.0.2", + "istanbul": "~0.2.1", + "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" + }, + "engines": { + "node": ">=0.10" + }, + "scripts": { + "test": "gulp test" }, "bin": { - "jsdoc": "./nodejs/bin/jsdoc" + "jsdoc": "./jsdoc.js" }, "bugs": { "url": "https://github.com/jsdoc3/jsdoc/issues" @@ -53,18 +67,21 @@ "email": "jeffrey.l.williams@gmail.com" } ], - "_id": "jsdoc@3.2.2", - "dist": { - "shasum": "3fbbcf9b6c585545c8c7ac18ec2e822aae3338bf", - "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.2.2.tgz" - }, - "_from": "jsdoc@<=3.3.0", - "_npmVersion": "1.3.11", + "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", "_npmUser": { "name": "hegemonic", "email": "jeffrey.l.williams@gmail.com" }, + "dist": { + "shasum": "8527b69bfcf5eaf2a6ae82ac01686151bba31660", + "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz" + }, "directories": {}, - "_shasum": "3fbbcf9b6c585545c8c7ac18ec2e822aae3338bf", - "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.2.2.tgz" + "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-jsdoc/node_modules/jsdoc/package.json.orig b/node_modules/jsdoc/package.json.orig similarity index 100% rename from node_modules/grunt-jsdoc/node_modules/jsdoc/package.json.orig rename to node_modules/jsdoc/package.json.orig diff --git a/node_modules/jsdoc/plugins/README.md b/node_modules/jsdoc/plugins/README.md deleted file mode 100644 index 04b6c68..0000000 --- a/node_modules/jsdoc/plugins/README.md +++ /dev/null @@ -1,389 +0,0 @@ -Creating and Enabling a Plugin ----- - -There are two steps required to create and enable a new JSDoc plugin: - -1. Create a JavaScript module to contain your plugin code. -2. Include that module in the "plugins" array of `conf.json`. You can specify -an absolute or relative path. If you use a relative path, JSDoc searches for -the plugin in the current working directory and the JSDoc directory, in that -order. - -For example, if your plugin source code was saved in the "plugins/shout.js" -file in the current working directory, you would include it by adding a -reference to it in conf.json like so: - - ... - "plugins": [ - "plugins/shout" - ] - ... - -Authoring JSDoc 3 Plugins ----- - -The plugin system for JSDoc 3 is pretty powerful and provides plugin authors -multiple methods, from high-level to low-level, of affecting document generation: - -- Defining event handlers -- Defining tags -- Defining a parse tree node processor - -### Event Handlers - -At the highest level, a plugin may register handlers for specific named-events -that occur in the documentation generation process. JSDoc will pass the handler -an event object containing pertinent information. Your plugin module should -export a _handlers_ object that contains your handler, like so: - - exports.handlers = { - newDoclet: function(e) { - //Do something when we see a new doclet - } - } - -#### Event: fileBegin - -This is triggered when the parser has started on a new file. You might use this -to do any per-file initialization your plugin needs to do. - -The event object will contain the following properties: - -- filename: the name of the file - -#### Event: beforeParse - -This is triggered before parsing has begun. You can use this method to modify -the source code that will be parsed. For instance, you might add some virtual -doclets so they get added to the documentation. - -The event object will contain the following properties: - -- filename: the name of the file -- source: the contents of the file - -Below is an example that adds a virtual doclet for a function to the source so -that it will get parsed and added to the documentation. This might be done to -document methods that will be present for end-user use, but might not be in the -source code being documented, like methods provided by a third-party superclass: - - exports.handlers = { - beforeParse: function(e) { - var extraDoc = ["", - "/**", - "Here's a description of this function", - "@name superFunc", - "@memberof ui.mywidget", - "@function", - "*/", ""]; - e.source += extraDoc.join("\n"); - } - } - -#### Event: jsdocCommentFound - -This is fired whenever a jsdoc comment is found. It may or may not be associated -with any code. You might use this to modify the contents of a comment before it -is processed. - -The event object will contain the following properties: - -- filename: the name of the file -- comment: the text of the comment -- lineno: the line number the comment was found on - -#### Event: symbolFound - -This is fired when the parser comes across a symbol in the code it thinks is -important. This usually means things that one might want to document -- -variables, functions, object literals, object property definitions, -assignments, etc., but the symbols the parser finds can be modified by a plugin -(see "Node Visitors" below). - -The event object will contain the following properties: - -- filename: the name of the file -- comment: the comment associated with the symbol, if any -- id: the unique id of the symbol -- lineno: the line number the symbols was found on -- range: an array containing the first and last characters of the code - associated with the symbol -- astnode: the node of the parse tree -- code: information about the code. This usually contains "name", "type", and - "node" properties and might also have "value", "paramnames", or "funcscope" - properties depending on the symbol. - -#### Event: newDoclet - -This is the highest level event and is fired when a new doclet has been created. -This means that a jsdoc or a symbol has been processed and the actual doclet -that will be passed to the template has been created. - -The event object will contain the following properties: - -- doclet: the new doclet that was created - -The properties of the doclet can vary depending on the comment or symbol used to -create it. Additionally, tag definitions (See "Tag Definitions" below) can -modify the doclet. Some common properties you're likely to see include: - -- comment: the text of the comment (may be empty if symbol is undocumented) -- meta: some information about the doclet, like filename, line number, etc. -- description -- kind -- name -- longname: the fully qualified name, including memberof info -- memberof: the function/class/namespace that this is a member of -- scope: (global|static|instance|inner) -- undocumented: true if the symbol didn't have a jsdoc comment -- defaultvalue: the specified default value for a property/variable -- type: the specified type of parameter/property/function return (e.g. Boolean) -- params: an object containing the list of parameters to a function -- tags: an object containing the set of tags not handled by the parser (note: - this is only available if ```allowUnknownTags``` is set to true in the conf.json - file for JSDoc3) - -Below is an example of a newDoclet handler that shouts the descriptions: - - exports.handlers = { - newDoclet: function(e) { - // e.doclet will refer to the newly created doclet - // you can read and modify properties of that doclet if you wish - if (typeof e.doclet.description === 'string') { - e.doclet.description = e.doclet.description.toUpperCase(); - } - } - }; - -#### Event: fileComplete - -This is fired when the parser is done with a file. You might use this to -perform some cleanup for your plugin. - -The event object will contain the following properties: - -- filename: the name of the file -- source: the contents of the file - -### Tag Definitions - -Adding tags to the tag dictionary is a mid-level way to affect documentation -generation. Before a newDoclet event is triggered, jsdoc comment blocks are -parsed to determine the description and any jsdoc tags that may be present. When -a tag is found, if it has been defined in the tag dictionary, it is given a -chance to modify the doclet. - -Plugins can define tags by exporting a _defineTags_ function. That function will -be passed a dictionary that can be used to define tags, like so: - - exports.defineTags = function(dictionary) { - //define tags here - } - -#### The Dictionary - -The dictionary provides the following methods: - -1. defineTag(title, opts) - Used to define tags. - The first parameter is the name of the tag (e.g. "param" or "overview"). the - second is an object containing options for the tag. The options can be the - following: - - mustHaveValue (Boolean): whether or not the tag must have a value - (e.g "@name TheName") - - mustNotHaveValue (Boolean): whether or not the tag must not have a value - - canHaveType (Boolean): Whether or not the tag can have a type - (e.g. "@param **{String}** name the description of name") - - canHaveName (Boolean): Whether or not the tag can have a name - (e.g. "@param {String} **name** the description of name") - - isNamespace (Boolean): Whether or not the tag marks a doclet as representing - a namespace. The "@module" tag, for instance, sets this to true. - - onTagged (Function): A callback function executed when the tag is found. The - function is passed two parameters: the doclet and the tag. Here's an example: - - dictionary.defineTag('instance', { - onTagged: function(doclet, tag) { - doclet.scope = "instance"; - } - }); - The defineTag method returns a Tag. The Tag object has a method "synonym" - that can be used to declare synonyms to the tag. For example: - - dictionary.defineTag('exception', { - - }) - .synonym('throws'); -2. lookUp(title) - Used to lookup a tag. Returns either the tag or false if it's not defined -3. isNamespace(kind) - Used to determine if a particular doclet type represents a namespace -4. normalise(title) - Used to find the canonical name of a tag. The name passed in might be that - name or a synonym - -### Node Visitors - -At the lowest level, plugin authors can process each node in the parse tree by -defining a node visitor that will visit each node, creating an opportunity to -do things like modify comments and trigger parser events for any arbitrary piece -of code. - -Plugins can define a node visitor by exporting a ```nodeVisitor``` object that -contains a ```visitNode``` function, like so: - - exports.nodeVisitor = { - visitNode: function(node, e, parser, currentSourceName) { - //do all sorts of crazy things here - } - } - -The function is called on each node with the following parameters: - -- node: the node of the parse tree -- e: the event. If the node is one that the parser handles, this will already - be populated with the same things described in the _symbolFound_ event above. - Otherwise, it will be an empty object on which to set various properties. -- parser: the parser -- currentSourceName: the name of the file being parsed - -#### Making things happen - -The primary reasons to implement a node visitor are to be able to document -things that aren't normally documented (like function calls that create classes) -or to auto generate documentation for code that isn't documented. For instance, -a plugin might look for calls to a "_trigger" method since it knows that means -an event is fired and then generate documentation for the event. - -To make things happen, the ```visitNode``` function should modify properties -of the event parameter. In general the goal is to construct a comment and then -get an event to fire. After the parser lets all of the node visitors have a -look at the node, it looks to see if the event object has a ```comment``` -property and an ```event``` property. If it has both, the event named in the event -property is fired. The event is usually "symbolFound" or "jsdocCommentFound", -but theoretically, a plugin could define its own events and handle them. - -#### Example - -Below is an example of what a plugin for documenting jQuery UI widgets might do. -jQuery UI uses a factory function call to create widget classes. The plugin -looks for that function call and creates a symbol with documentation. It also -looks for any "this._trigger" function calls and automatically creates -documentation for the events that are triggered: - - exports.nodeVisitor = { - visitNode: function(node, e, parser, currentSourceName) { - if (node.type === Token.OBJECTLIT && node.parent && node.parent.type === Token.CALL && isInWidgetFactory(node, 1)) { - var widgetName = node.parent.arguments.get(0).toSource(); - e.id = 'astnode' + node.hashCode(); // the id of the object literal node - e.comment = String(node.parent.jsDoc||''); - e.lineno = node.parent.getLineno(); - e.filename = currentSourceName; - e.astnode = node; - e.code = { - name: "" + widgetName.substring(1, widgetName.length() - 1), - type: "class", - node: node - }; - e.event = "symbolFound"; - e.finishers = [parser.addDocletRef]; - - addCommentTag(e, "param", "{Object=} options A set of configuration options"); - } - else if(isTriggerCall(node)) { - var nameNode = node.arguments.get(0); - eventName = String((nameNode.type == Token.STRING) ? nameNode.value : nameNode.toSource()), - func = {}, - comment = "@event\n", - eventKey = ""; - - if (node.enclosingFunction) { - func.id = 'astnode'+node.enclosingFunction.hashCode(); - func.doclet = parser.refs[func.id]; - } - if(func.doclet) { - func.doclet.addTag("fires", eventName); - if (func.doclet.memberof) { - eventKey = func.doclet.memberof + "#event:" + eventName; - comment += "@name " + func.doclet.memberof + "#" + eventName; - } - } - e.comment = comment; - e.lineno = node.getLineno(); - e.filename = currentSourceName; - e.event = "jsdocCommentFound"; - } - } - }; - function isTriggerCall(node) { - if(node.type != Token.CALL) { return false; } - var target = node.getTarget(), - left = target && target.left && String(target.left.toSource()), - right = target && target.right && String(target.right.toSource()); - return (left === "this" && right === "_trigger"); - } - - function isInWidgetFactory(node, depth) { - var parent = node.parent, - d = 0; - while(parent && (!depth || d < depth)) { - if (parent.type === Token.CALL) { - var target = parent.getTarget(), - left = target && target.left && String(target.left.toSource()), - right = target && target.right && String(target.right.toSource()); - return ((left === "$" || left === "jQuery") && right === "widget"); - } else { - parent = parent.parent; - d++; - } - } - return false; - } - -You'll notice a "finishers" property set. The finishers property should contain -an array of functions to be called after the event is fired and all the handlers -have processed it. The parser provides an ```addDocletRef``` function that adds the -doclet to the map (keyed off of the id property) of doclets it knows about. - -Lastly, the visitors are executed in the order the plugins are listed in the -conf.json file. A plugin can stop later plugins from visiting a node by -setting a ```stopPropagation``` property on the event object (e.stopPropagation = true). -A plugin can stop the event from firing setting a ```preventDefault``` property. - -### Throwing Errors - -If you wish your plugin to throw an error, do it using the `handle` function in -the `jsdoc/util/error` module: - - require('jsdoc/util/error').handle( new Error('I do not like green eggs and ham!') ); - -By default, this will throw the error, halting the execution of JSDoc. However, -if the user enabled JSDoc's `--lenient` switch, JSDoc will simply log the error -to the console and continue. - -Packaging JSDoc 3 Plugins ----- - -The JSDoc 3 Jakefile has an ```install``` task that can be used to install a -plugin into the JSDoc directory. So running the following will install the -plugin: - - $>jake install[path/to/YourPluginFolder] - -**Note**: On some operating systems, including OS X, you may need to quote the -target name and parameters: - - $>jake 'install[path/to/YourPluginFolder]' - -The task is passed a directory that should look something like the following: - - YourPluginFolder - |- plugins - | |- YourPlugin.js - | \- test - | |- fixtures - | | \- YourFixtures.js - | \- specs - | \- YourTests.js - \- templates - \- YourTemplate - \- publish.js diff --git a/node_modules/jsdoc/plugins/commentConvert.js b/node_modules/jsdoc/plugins/commentConvert.js index 244c331..cac6d87 100644 --- a/node_modules/jsdoc/plugins/commentConvert.js +++ b/node_modules/jsdoc/plugins/commentConvert.js @@ -3,7 +3,7 @@ @module plugins/commentConvert @author Michael Mathews */ - +'use strict'; exports.handlers = { /// diff --git a/node_modules/jsdoc/plugins/commentsOnly.js b/node_modules/jsdoc/plugins/commentsOnly.js index e5106e9..a35e96f 100644 --- a/node_modules/jsdoc/plugins/commentsOnly.js +++ b/node_modules/jsdoc/plugins/commentsOnly.js @@ -5,6 +5,7 @@ * @module plugins/commentsOnly * @author Jeff Williams */ +'use strict'; exports.handlers = { beforeParse: function(e) { diff --git a/node_modules/jsdoc/plugins/escapeHtml.js b/node_modules/jsdoc/plugins/escapeHtml.js index d77c262..d587405 100644 --- a/node_modules/jsdoc/plugins/escapeHtml.js +++ b/node_modules/jsdoc/plugins/escapeHtml.js @@ -3,7 +3,7 @@ @module plugins/escapeHtml @author Michael Mathews */ - +'use strict'; exports.handlers = { /** diff --git a/node_modules/jsdoc/plugins/eventDumper.js b/node_modules/jsdoc/plugins/eventDumper.js index 2785745..38ca843 100644 --- a/node_modules/jsdoc/plugins/eventDumper.js +++ b/node_modules/jsdoc/plugins/eventDumper.js @@ -4,11 +4,13 @@ * @module plugins/eventDumper * @author Jeff Williams */ +'use strict'; var _ = require('underscore'); var util = require('util'); var conf = env.conf.eventDumper || {}; +var isRhino = require('jsdoc/util/runtime').isRhino(); // Dump the included parser events (defaults to all events) var events = conf.include || [ @@ -28,7 +30,52 @@ if (conf.exclude) { } /** - * Get rid of native Java crud in an event object so that JSON.stringify() works. + * Check whether a variable appears to be a Java native object. + * + * @param {*} o - The variable to check. + * @return {boolean} Set to `true` for Java native objects and `false` in all other cases. + */ +function isJavaNativeObject(o) { + if (!isRhino) { + return false; + } + + return o && typeof o === 'object' && typeof o.getClass === 'function'; +} + +/** + * Replace AST node objects in events with a placeholder. + * + * @param {Object} o - An object whose properties may contain AST node objects. + * @return {Object} The modified object. + */ +function replaceNodeObjects(o) { + var doop = require('jsdoc/util/doop'); + + var OBJECT_PLACEHOLDER = ''; + + if (o.code && o.code.node) { + // don't break the original object! + o.code = doop(o.code); + o.code.node = OBJECT_PLACEHOLDER; + } + + if (o.doclet && o.doclet.meta && o.doclet.meta.code && o.doclet.meta.code.node) { + // don't break the original object! + o.doclet.meta.code = doop(o.doclet.meta.code); + o.doclet.meta.code.node = OBJECT_PLACEHOLDER; + } + + if (o.astnode) { + o.astnode = OBJECT_PLACEHOLDER; + } + + return o; +} + +/** + * Get rid of unwanted crud in an event object. + * * @param {object} e The event object. * @return {object} The fixed-up object. */ @@ -42,22 +89,20 @@ function cleanse(e) { result[prop] = 'function[' + e[prop].length + ']'; } // never include functions that belong to the object - else if (typeof e[prop] === 'function') { - // do nothing - } - // go down an extra level for these - else if (['code', 'doclet', 'meta'].indexOf(prop) !== -1) { - result[prop] = cleanse(e[prop]); - } - else { - result[prop] = String(e[prop]); + else if (typeof e[prop] !== 'function') { + // don't call JSON.stringify() on Java native objects--Rhino will throw an exception + result[prop] = isJavaNativeObject(e[prop]) ? String(e[prop]) : e[prop]; } }); + // allow users to omit node objects, which can be enormous + if (conf.omitNodes) { + result = replaceNodeObjects(result); + } + return result; } - exports.handlers = {}; events.forEach(function(eventType) { diff --git a/node_modules/jsdoc/plugins/markdown.js b/node_modules/jsdoc/plugins/markdown.js index 1271bb5..7c7df69 100644 --- a/node_modules/jsdoc/plugins/markdown.js +++ b/node_modules/jsdoc/plugins/markdown.js @@ -5,8 +5,10 @@ * @author Michael Mathews * @author Ben Blank */ +'use strict'; + var conf = env.conf.markdown; -var defaultTags = [ "classdesc", "description", "params", "properties", "returns", "see"]; +var defaultTags = [ 'classdesc', 'description', 'params', 'properties', 'returns', 'see']; var hasOwnProp = Object.prototype.hasOwnProperty; var parse = require('jsdoc/util/markdown').getParser(); var tags = []; @@ -38,7 +40,7 @@ function process(doclet) { return; } - if (typeof doclet[tag] === "string" && shouldProcessString(tag, doclet[tag]) ) { + if (typeof doclet[tag] === 'string' && shouldProcessString(tag, doclet[tag]) ) { doclet[tag] = parse(doclet[tag]); } else if ( Array.isArray(doclet[tag]) ) { diff --git a/node_modules/jsdoc/plugins/overloadHelper.js b/node_modules/jsdoc/plugins/overloadHelper.js index 35fe321..29c384d 100644 --- a/node_modules/jsdoc/plugins/overloadHelper.js +++ b/node_modules/jsdoc/plugins/overloadHelper.js @@ -3,10 +3,10 @@ * overloaded functions and methods. In JSDoc, this string is known as a _variation_. (The longnames * of overloaded constructor functions are _not_ updated, so that JSDoc can identify the class' * members correctly.) - * + * * Using this plugin allows you to link to overloaded functions without manually adding `@variation` * tags to your documentation. - * + * * For example, suppose your code includes a function named `foo` that you can call in the * following ways: * @@ -36,6 +36,7 @@ * @author Jeff Williams * @license Apache License 2.0 */ +'use strict'; // lookup table of function doclets by longname var functionDoclets; @@ -103,7 +104,7 @@ function getUniqueVariations(doclets) { docletKeys.forEach(function(doclet) { variations[doclet] = doclets[doclet].variation || getParamVariation(doclets[doclet]); }); - + // if they're identical, try again, without preserving existing variations if ( !hasUniqueValues(variations) ) { docletKeys.forEach(function(doclet) { diff --git a/node_modules/jsdoc/plugins/partial.js b/node_modules/jsdoc/plugins/partial.js index 61d20d2..2718adc 100644 --- a/node_modules/jsdoc/plugins/partial.js +++ b/node_modules/jsdoc/plugins/partial.js @@ -4,6 +4,7 @@ @module plugins/partial @author Ludo Antonov */ +'use strict'; var fs = require('jsdoc/fs'); var path = require('path'); diff --git a/node_modules/jsdoc/plugins/railsTemplate.js b/node_modules/jsdoc/plugins/railsTemplate.js index 9ca6309..6a408f6 100644 --- a/node_modules/jsdoc/plugins/railsTemplate.js +++ b/node_modules/jsdoc/plugins/railsTemplate.js @@ -3,7 +3,7 @@ @module plugins/railsTemplate @author Jannon Frank */ - +'use strict'; exports.handlers = { /** @@ -14,7 +14,7 @@ exports.handlers = { */ beforeParse: function(e) { if (e.filename.match(/\.erb$/)) { - e.source = e.source.replace(/<%.*%>/g, ""); + 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 bb9c2c5..34ed07c 100644 --- a/node_modules/jsdoc/plugins/shout.js +++ b/node_modules/jsdoc/plugins/shout.js @@ -3,6 +3,7 @@ @module plugins/shout @author Michael Mathews */ +'use strict'; exports.handlers = { /** diff --git a/node_modules/jsdoc/plugins/sourcetag.js b/node_modules/jsdoc/plugins/sourcetag.js index efde8e0..2385426 100644 --- a/node_modules/jsdoc/plugins/sourcetag.js +++ b/node_modules/jsdoc/plugins/sourcetag.js @@ -2,12 +2,20 @@ @module plugins/sourcetag @author Michael Mathews */ +'use strict'; + +var logger = require('jsdoc/util/logger'); exports.handlers = { /** Support @source tag. Expected value like: { "filename": "myfile.js", "lineno": 123 } Modifies the corresponding meta values on the given doclet. + + WARNING: If you are using a JSDoc template that generates pretty-printed source files, + such as JSDoc's default template, this plugin can cause JSDoc to crash. To fix this issue, + update your template settings to disable pretty-printed source files. + @source { "filename": "sourcetag.js", "lineno": 13 } */ newDoclet: function(e) { @@ -31,7 +39,8 @@ exports.handlers = { value = JSON.parse(tag.value); } catch(e) { - throw new Error('@source tag expects a valid JSON value, like { "filename": "myfile.js", "lineno": 123 }.'); + logger.error('@source tag expects a valid JSON value, like { "filename": "myfile.js", "lineno": 123 }.'); + return; } e.doclet.meta = e.doclet.meta || {}; @@ -40,4 +49,4 @@ exports.handlers = { } } } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb b/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb index 446aa40..c3df649 100644 --- a/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb +++ b/node_modules/jsdoc/plugins/test/fixtures/railsTemplate.js.erb @@ -4,7 +4,6 @@ @author Jannon Frank */ - exports.handlers = { /** * Remove rails tags from the source input (e.g. <% foo bar %>) diff --git a/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js b/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js index 5713761..6aba419 100644 --- a/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js +++ b/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js @@ -9,4 +9,3 @@ function foo() { */ function bar() { } - diff --git a/node_modules/jsdoc/plugins/test/specs/commentConvert.js b/node_modules/jsdoc/plugins/test/specs/commentConvert.js index 3f1dc08..dc29b80 100644 --- a/node_modules/jsdoc/plugins/test/specs/commentConvert.js +++ b/node_modules/jsdoc/plugins/test/specs/commentConvert.js @@ -1,11 +1,16 @@ -/*global describe: true, expect: true, it: true, jasmine: true */ +/*global describe: true, env: true, expect: true, it: true, jasmine: true */ describe("commentConvert plugin", function() { - var parser = new (require("jsdoc/src/parser")).Parser(), - plugin = require('plugins/commentConvert'), - docSet; + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); - require('jsdoc/plugins').installPlugins(['plugins/commentConvert'], parser); - docSet = jasmine.getDocSetFromFile("plugins/commentConvert.js", parser); + var docSet; + + var pluginPath = 'plugins/commentConvert'; + var pluginPathResolved = path.join(env.dirname, pluginPath); + var plugin = require(pluginPathResolved); + + require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); + docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); it("should convert '///-style comments into jsdoc comments", function() { var doclet = docSet.getByLongname("module:plugins/commentConvert.handlers.beforeParse"); diff --git a/node_modules/jsdoc/plugins/test/specs/escapeHtml.js b/node_modules/jsdoc/plugins/test/specs/escapeHtml.js index 8bd8821..0698938 100644 --- a/node_modules/jsdoc/plugins/test/specs/escapeHtml.js +++ b/node_modules/jsdoc/plugins/test/specs/escapeHtml.js @@ -1,11 +1,16 @@ -/*global describe: true, expect: true, it: true, jasmine: true */ +/*global describe: true, env: true, expect: true, it: true, jasmine: true */ describe("escapeHtml plugin", function() { - var parser = new (require("jsdoc/src/parser")).Parser(), - plugin = require('plugins/escapeHtml'), - docSet; + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); - require('jsdoc/plugins').installPlugins(['plugins/escapeHtml'], parser); - docSet = jasmine.getDocSetFromFile("plugins/escapeHtml.js", parser); + var docSet; + + var pluginPath = 'plugins/escapeHtml'; + var pluginPathResolved = path.join(env.dirname,pluginPath); + var plugin = require(pluginPathResolved); + + require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); + docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); it("should escape '&', '<' and newlines in doclet descriptions", function() { var doclet = docSet.getByLongname("module:plugins/escapeHtml.handlers.newDoclet"); diff --git a/node_modules/jsdoc/plugins/test/specs/markdown.js b/node_modules/jsdoc/plugins/test/specs/markdown.js index ce08324..c9d89cc 100644 --- a/node_modules/jsdoc/plugins/test/specs/markdown.js +++ b/node_modules/jsdoc/plugins/test/specs/markdown.js @@ -1,22 +1,29 @@ +/*global describe: true, env: true, expect: true, it: true, jasmine: true */ + +var path = require('jsdoc/path'); + describe("markdown plugin", function() { //TODO }); describe("markdown see tag support", function() { - var plugin = require('plugins/markdown'), - docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/seetag-markdown.js'), - foo = docSet.getByLongname('foo')[0], - bar = docSet.getByLongname('bar')[0]; + var pluginPath = 'plugins/markdown'; + var pluginPathResolved = path.join(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]; 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'); - }) -}); \ No newline at end of file + }); +}); diff --git a/node_modules/jsdoc/plugins/test/specs/overloadHelper.js b/node_modules/jsdoc/plugins/test/specs/overloadHelper.js index c57d213..0538fa4 100644 --- a/node_modules/jsdoc/plugins/test/specs/overloadHelper.js +++ b/node_modules/jsdoc/plugins/test/specs/overloadHelper.js @@ -1,10 +1,15 @@ -/*global describe: true, expect: true, it: true, jasmine: true, xit: true */ +/*global describe: true, env: true, expect: true, it: true, jasmine: true, xit: true */ describe('plugins/overloadHelper', function() { - var parser = new (require('jsdoc/src/parser')).Parser(); - var plugin = require('plugins/overloadHelper'); + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); + var docSet; - require('jsdoc/plugins').installPlugins(['plugins/overloadHelper'], parser); + var pluginPath = 'plugins/overloadHelper'; + var pluginPathResolved = path.resolve(env.dirname, pluginPath); + var plugin = require(pluginPathResolved); + + require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/overloadHelper.js', parser); it('should exist', function() { diff --git a/node_modules/jsdoc/plugins/test/specs/railsTemplate.js b/node_modules/jsdoc/plugins/test/specs/railsTemplate.js index 2f89ee5..feebd74 100644 --- a/node_modules/jsdoc/plugins/test/specs/railsTemplate.js +++ b/node_modules/jsdoc/plugins/test/specs/railsTemplate.js @@ -1,15 +1,16 @@ -/*global describe: true, expect: true, it: true */ +/*global describe: true, env: true, expect: true, it: true, jasmine: true */ describe("railsTemplate plugin", function() { - var parser = new (require("jsdoc/src/parser")).Parser(), - plugin = require('plugins/railsTemplate'); + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); + var pluginPath = path.join(env.dirname, 'plugins/railsTemplate'); + var plugin = require(pluginPath); - require('jsdoc/plugins').installPlugins(['plugins/railsTemplate'], parser); + require('jsdoc/plugins').installPlugins([pluginPath], parser); require('jsdoc/src/handlers').attachTo(parser); it("should remove <% %> rails template tags from the source of *.erb files", function() { - var path = require("path"), - docSet = parser.parse([path.join(__dirname, "plugins/test/fixtures/railsTemplate.js.erb")]); + var docSet = parser.parse([path.join(env.dirname, "plugins/test/fixtures/railsTemplate.js.erb")]); expect(docSet[2].description).toEqual("Remove rails tags from the source input (e.g. )"); }); diff --git a/node_modules/jsdoc/plugins/test/specs/shout.js b/node_modules/jsdoc/plugins/test/specs/shout.js index 75e70b6..7b59184 100644 --- a/node_modules/jsdoc/plugins/test/specs/shout.js +++ b/node_modules/jsdoc/plugins/test/specs/shout.js @@ -1,11 +1,16 @@ -/*global describe: true, expect: true, it: true, jasmine: true */ +/*global describe: true, env: true, expect: true, it: true, jasmine: true */ describe("shout plugin", function() { - var parser = new (require("jsdoc/src/parser")).Parser(), - plugin = require('plugins/shout'), - docSet; + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); - require('jsdoc/plugins').installPlugins(['plugins/shout'], parser); - docSet = jasmine.getDocSetFromFile("plugins/shout.js", parser); + var docSet; + + var pluginPath = 'plugins/shout'; + var pluginPathResolved = path.join(env.dirname, pluginPath); + var plugin = require(pluginPathResolved); + + require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); + docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); it("should make the description uppercase", function() { var doclet = docSet.getByLongname("module:plugins/shout.handlers.newDoclet"); diff --git a/node_modules/jsdoc/plugins/test/specs/sourcetag.js b/node_modules/jsdoc/plugins/test/specs/sourcetag.js index 84d6533..ab154bf 100644 --- a/node_modules/jsdoc/plugins/test/specs/sourcetag.js +++ b/node_modules/jsdoc/plugins/test/specs/sourcetag.js @@ -1,11 +1,16 @@ -/*global describe: true, expect: true, it: true, jasmine: true */ +/*global describe: true, env: true, expect: true, it: true, jasmine: true */ describe("sourcetag plugin", function() { - var parser = new (require("jsdoc/src/parser")).Parser(), - plugin = require('plugins/sourcetag'), - docSet; + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); - require('jsdoc/plugins').installPlugins(['plugins/sourcetag'], parser); - docSet = jasmine.getDocSetFromFile("plugins/sourcetag.js", parser); + var docSet; + + var pluginPath = 'plugins/sourcetag'; + var pluginPathResolved = path.join(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"); diff --git a/node_modules/jsdoc/plugins/test/specs/verboseOutput.js b/node_modules/jsdoc/plugins/test/specs/verboseOutput.js deleted file mode 100644 index e8ac43b..0000000 --- a/node_modules/jsdoc/plugins/test/specs/verboseOutput.js +++ /dev/null @@ -1,19 +0,0 @@ -/*global describe: true, expect: true, it: true, jasmine: true, xit: true */ -/** - * @author Rob Taylor [manix84@gmail.com] - */ - -describe("verbose output plugin", function () { - var parser = new (require("jsdoc/src/parser")).Parser(), - plugin = require('plugins/verboseOutput'), - docSet; - - //require('jsdoc/plugins').installPlugins(['plugins/verboseOutput'], parser); - docSet = jasmine.getDocSetFromFile("plugins/verboseOutput.js", parser); - - xit("should log file names to console", function() { - // TODO: this doesn't actually test the plugin... - var fileBegin = docSet.getByLongname("module:plugins/verboseOutput.handlers.fileBegin"); - expect(fileBegin[0].description).toEqual("Logging the file name to the console."); - }); -}); diff --git a/node_modules/jsdoc/plugins/verboseOutput.js b/node_modules/jsdoc/plugins/verboseOutput.js deleted file mode 100644 index 454a4a0..0000000 --- a/node_modules/jsdoc/plugins/verboseOutput.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Adds a verbose output to the console, so that you can see what's happening in your process. - * @module plugins/verboseOutput - * @author Rob Taylor - The basic idea - * @author Michael Mathews - Wrote the first itteration with me :) - */ - -exports.handlers = { - /** - * Logging the file name to the console. - */ - fileBegin: function (data) { - console.log(data.filename); - } -}; diff --git a/node_modules/jsdoc/rhino/MPL_1.1.txt b/node_modules/jsdoc/rhino/MPL_1.1.txt deleted file mode 100644 index 7714141..0000000 --- a/node_modules/jsdoc/rhino/MPL_1.1.txt +++ /dev/null @@ -1,470 +0,0 @@ - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. - Portions created by ______________________ are Copyright (C) ______ - _______________________. All Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms - of the _____ license (the "[___] License"), in which case the - provisions of [______] License are applicable instead of those - above. If you wish to allow use of your version of this file only - under the terms of the [____] License and not to allow others to use - your version of this file under the MPL, indicate your decision by - deleting the provisions above and replace them with the notice and - other provisions required by the [___] License. If you do not delete - the provisions above, a recipient may use your version of this file - under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - diff --git a/node_modules/jsdoc/rhino/crypto.js b/node_modules/jsdoc/rhino/crypto.js deleted file mode 100644 index 487e55c..0000000 --- a/node_modules/jsdoc/rhino/crypto.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('crypto-browserify'); diff --git a/node_modules/jsdoc/rhino/events.js b/node_modules/jsdoc/rhino/events.js deleted file mode 100644 index 4546ada..0000000 --- a/node_modules/jsdoc/rhino/events.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Shim for Node.js `events` module. Adapted from `node-browserify`. - * @see https://github.com/substack/node-browserify - * @license MIT - */ - -if (!process.EventEmitter) { - process.EventEmitter = function () {}; -} - -var EventEmitter = exports.EventEmitter = process.EventEmitter; -var isArray = typeof Array.isArray === 'function' ? - Array.isArray : - function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; - } -; - -// By default EventEmitters will print a warning if more than -// 10 listeners are added to it. This is a useful default which -// helps finding memory leaks. -// -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -var defaultMaxListeners = 10; -EventEmitter.prototype.setMaxListeners = function(n) { - if (!this._events) { - this._events = {}; - } - this._events.maxListeners = n; -}; - - -EventEmitter.prototype.emit = function(type) { - var args; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events || !this._events.error || - (isArray(this._events.error) && !this._events.error.length)) - { - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - if (!this._events) { - return false; - } - var handler = this._events[type]; - if (!handler) { - return false; - } - - if (typeof handler == 'function') { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - return true; - - } else if (isArray(handler)) { - args = Array.prototype.slice.call(arguments, 1); - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - return true; - - } else { - return false; - } -}; - -// EventEmitter is defined in src/node_events.cc -// EventEmitter.prototype.emit() is also defined there. -EventEmitter.prototype.addListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('addListener only takes instances of Function'); - } - - if (!this._events) { - this._events = {}; - } - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } else if (isArray(this._events[type])) { - - // Check for listener leak - if (!this._events[type].warned) { - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - - // If we've already got an array, just append. - this._events[type].push(listener); - } else { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - var self = this; - self.on(type, function g() { - self.removeListener(type, g); - listener.apply(this, arguments); - }); - - return this; -}; - -EventEmitter.prototype.removeListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('removeListener only takes instances of Function'); - } - - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events || !this._events[type]) { - return this; - } - - var list = this._events[type]; - - if (isArray(list)) { - var i = list.indexOf(listener); - if (i < 0) { - return this; - } - list.splice(i, 1); - if (list.length === 0) { - delete this._events[type]; - } - } else if (this._events[type] === listener) { - delete this._events[type]; - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - // does not use listeners(), so no side effect of creating _events[type] - if (type && this._events && this._events[type]) { - this._events[type] = null; - } - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - if (!this._events) { - this._events = {}; - } - if (!this._events[type]) { - this._events[type] = []; - } - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; -}; diff --git a/node_modules/jsdoc/rhino/fs.js b/node_modules/jsdoc/rhino/fs.js deleted file mode 100644 index eeb29c6..0000000 --- a/node_modules/jsdoc/rhino/fs.js +++ /dev/null @@ -1,176 +0,0 @@ -/*global Packages: true */ - -/** - * Partial Rhino shim for Node.js' `fs` module. - * @see http://nodejs.org/api/fs.html - */ - -var path = require('path'); - -var asyncify = path._asyncify; - -function checkEncoding(enc, name) { - // we require the `encoding` parameter for Node.js compatibility; on Node.js, if you omit the - // encoding, you get a stream instead of a string - if (!enc || typeof enc === 'function') { - throw new Error(name + ' requires an encoding on Rhino!'); - } - - // Node.js wants 'utf8', but Java wants 'utf-8' - if (enc === 'utf8') { - enc = 'utf-8'; - } - - return enc; -} - -exports.readFileSync = function(filename, encoding) { - encoding = checkEncoding(encoding, 'fs.readFile[Sync]'); - - return readFile(filename, encoding); -}; -exports.readFile = asyncify(exports.readFileSync); - -// in node 0.8, path.exists() and path.existsSync() moved to the "fs" module -exports.existsSync = path.existsSync; -exports.exists = path.exists; - -var statSync = exports.statSync = function(_path) { - var f = new java.io.File(_path); - return { - isFile: function() { - return f.isFile(); - }, - isDirectory: function() { - return f.isDirectory(); - } - }; -}; -exports.stat = asyncify(statSync); - -var readdirSync = exports.readdirSync = function(_path) { - var dir; - var files; - - dir = new java.io.File(_path); - if (!dir.directory) { - throw new Error("ENOENT, no such file or directory '" + _path + "'"); - } - - files = dir.list(); - - // Convert files to Javascript strings so they play nice with node modules - files = files.map(function(fileName) { - return String(fileName); - }); - - return files; -}; -exports.readdir = asyncify(readdirSync); - -// JSDoc extension to `fs` module -var ls = exports.ls = function(dir, recurse, _allFiles, _path) { - var files, - file; - - if (typeof _path === 'undefined') { // initially - _allFiles = []; - _path = [dir]; - } - - if (_path.length === 0) { return _allFiles; } - if (typeof recurse === 'undefined') { recurse = 1; } - - if ( statSync(dir).isFile(dir) ) { - files = [dir]; - } - else { - files = readdirSync(dir); - } - - for (var f = 0, lenf = files.length; f < lenf; f++) { - file = String(files[f]); - - if (file.match(/^\.[^\.\/\\]/)) { continue; } // skip dot files - - if ((new java.io.File(_path.join('/') + '/' + file)).list()) { // it's a directory - _path.push(file); - - if (_path.length - 1 < recurse) { - ls(_path.join('/'), recurse, _allFiles, _path); - } - _path.pop(); - } - else { // it's a file - _allFiles.push( - path.normalize(_path.join('/') + '/' + file) - ); - } - } - - return _allFiles; -}; - -// JSDoc extension to `fs` module -var toDir = exports.toDir = function(_path) { - var f = new java.io.File(_path); - - if (f.isDirectory()){ - return _path; - } else { - return path.dirname(_path); - } -}; - -var mkdirSync = exports.mkdirSync = function(_path) { - var dir_path = toDir(_path); - (new java.io.File(dir_path)).mkdir(); -}; -exports.mkdir = asyncify(mkdirSync); - -// JSDoc extension to `fs` module -exports.mkPath = function(/**Array*/ _path) { - if (_path.constructor == Array) { _path = _path.join(''); } - - (new java.io.File(_path)).mkdirs(); -}; - -// JSDoc extension to `fs` module -exports.copyFileSync = function(inFile, outDir, fileName) { - if (fileName == null){fileName = path.basename(inFile);} - - outDir = toDir(outDir); - - inFile = new java.io.File(inFile); - var outFile = new java.io.File(outDir+'/'+fileName); - - var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096); - var bos = new Packages.java.io.BufferedOutputStream(new Packages.java.io.FileOutputStream(outFile), 4096); - var theChar; - while ((theChar = bis.read()) != -1) { - bos.write(theChar); - } - bos.close(); - bis.close(); -}; -exports.copyFile = asyncify(exports.copyFileSync); - -exports.writeFileSync = function(filename, data, encoding) { - encoding = checkEncoding(encoding, 'fs.writeFile[Sync]'); - - var out = new Packages.java.io.PrintWriter( - new Packages.java.io.OutputStreamWriter( - new Packages.java.io.FileOutputStream(filename), - encoding - ) - ); - - try { - out.write(data); - } - finally { - out.flush(); - out.close(); - } -}; -exports.writeFile = asyncify(exports.writeFileSync); diff --git a/node_modules/jsdoc/rhino/js.jar b/node_modules/jsdoc/rhino/js.jar deleted file mode 100644 index a6a87eb..0000000 Binary files a/node_modules/jsdoc/rhino/js.jar and /dev/null differ diff --git a/node_modules/jsdoc/rhino/jsdoc.js b/node_modules/jsdoc/rhino/jsdoc.js deleted file mode 100644 index f3de7b8..0000000 --- a/node_modules/jsdoc/rhino/jsdoc.js +++ /dev/null @@ -1,9 +0,0 @@ -// Platform-specific functions to support jsdoc.js - -exports.pathToUri = function(_path) { - return String( new java.io.File(_path).toURI() ); -}; - -exports.uriToPath = function(uri) { - return String( new java.io.File(new java.net.URI(uri)) ); -}; diff --git a/node_modules/jsdoc/rhino/jsdoc/util/include.js b/node_modules/jsdoc/rhino/jsdoc/util/include.js deleted file mode 100644 index db0ef19..0000000 --- a/node_modules/jsdoc/rhino/jsdoc/util/include.js +++ /dev/null @@ -1,7 +0,0 @@ -/*global Packages: true */ -module.exports = function(filepath) { - var myGlobal = require('jsdoc/util/global'); - - var cx = Packages.org.mozilla.javascript.Context.getCurrentContext(); - Packages.org.mozilla.javascript.tools.shell.Main.processFile(cx, myGlobal, filepath); -}; diff --git a/node_modules/jsdoc/rhino/os.js b/node_modules/jsdoc/rhino/os.js deleted file mode 100644 index ea9553c..0000000 --- a/node_modules/jsdoc/rhino/os.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Partial Rhino implementation of Node.js' `os` module. - * @module os - * @author Jeff Williams - * @see http://nodejs.org/api/os.html - */ - -exports.EOL = String( java.lang.System.getProperty('line.separator') ); - -// clearly not accurate, but probably good enough -exports.platform = function() { - if ( String(java.lang.System.getProperty('os.name')).match(/^[Ww]in/) ) { - return 'win32'; - } - else { - return 'linux'; - } -}; \ No newline at end of file diff --git a/node_modules/jsdoc/rhino/path.js b/node_modules/jsdoc/rhino/path.js deleted file mode 100644 index 73df076..0000000 --- a/node_modules/jsdoc/rhino/path.js +++ /dev/null @@ -1,399 +0,0 @@ -var isWindows = java.lang.System.getProperty("os.name").toLowerCase().contains("windows"); -var fileSeparator = exports.sep = String( java.lang.System.getProperty("file.separator") ); - -function noOp() {} - -// exported for the benefit of our `fs` shim -var asyncify = exports._asyncify = function(func) { - return function() { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var data; - - callback = typeof callback === 'function' ? callback : noOp; - - try { - data = func.apply(this, args); - process.nextTick(function() { - callback(null, data); - }); - } - catch (e) { - process.nextTick(function() { - callback(e); - }); - } - }; -}; - -/** - * Returns everything on a path except for the last item - * e.g. if the path was 'path/to/something', the return value would be 'path/to' - */ -exports.dirname = function(_path) { - var f = new java.io.File(_path); - return String(f.getParent()); -}; - -/** - * Returns the last item on a path - */ -exports.basename = function(_path, ext) { - var f = new java.io.File(_path); - var p = f.getParentFile(); - var base = String(f.getName()); - if (p != null) { - var idx = ext ? base.indexOf(ext) : -1; - if (idx !== -1) { - base = base.substring(0, base.length - ext.length); - } - } - return base; -}; - -exports.existsSync = function(_path) { - var f = new java.io.File(_path); - - if (f.isDirectory()){ - return true; - } - if (!f.exists()){ - return false; - } - if (!f.canRead()){ - return false; - } - return true; -}; - -exports.exists = asyncify(exports.existsSync); - -//Code below taken from node - -//resolves . and .. elements in a path array with directory names there -//must be no slashes, empty elements, or device names (c:\) in the array -//(so also no leading and trailing slashes - it does not distinguish -//relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for ( var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last == '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -if (isWindows) { - // Regex to split a windows path into three parts: [*, device, slash, - // tail] windows-only - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?([\s\S]*?)$/; - - // path.resolve([from ...], to) - // windows version - exports.resolve = function() { - var resolvedDevice = '', - resolvedTail = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1; i--) { - var path; - if (i >= 0) { - path = arguments[i]; - } else if (!resolvedDevice) { - path = process.cwd(); - } else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive. We're sure the device is not - // an unc path at this points, because unc paths are always absolute. - path = process.env['=' + resolvedDevice]; - // Verify that a drive-local cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (!path || path.substr(0, 3).toLowerCase() !== - resolvedDevice.toLowerCase() + '\\') { - path = resolvedDevice + '\\'; - } - } - - // Skip empty and invalid entries - if (typeof path !== 'string' || !path) { - continue; - } - - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = device && device.charAt(1) !== ':', - isAbsolute = !!result[2] || isUnc, // UNC paths are always absolute - tail = result[3]; - - if (device && - resolvedDevice && - device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - - if (!resolvedDevice) { - resolvedDevice = device; - } - if (!resolvedAbsolute) { - resolvedTail = tail + '\\' + resolvedTail; - resolvedAbsolute = isAbsolute; - } - - if (resolvedDevice && resolvedAbsolute) { - break; - } - } - - // Replace slashes (in UNC share name) by backslashes - resolvedDevice = resolvedDevice.replace(/\//g, '\\'); - - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - - // Normalize the tail path - - function f(p) { - return !!p; - } - - resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f), - !resolvedAbsolute).join('\\'); - - return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || - '.'; - }; - - // windows version - exports.normalize = function(_path) { - var result = splitDeviceRe.exec(_path), - device = result[1] || '', - isUnc = device && device.charAt(1) !== ':', - isAbsolute = !!result[2] || isUnc, // UNC paths are always absolute - tail = result[3], - trailingSlash = /[\\\/]$/.test(tail); - - // Normalize the tail path - tail = normalizeArray(tail.split(/[\\\/]+/).filter(function(p) { - return !!p; - }), !isAbsolute).join('\\'); - - if (!tail && !isAbsolute) { - tail = '.'; - } - if (tail && trailingSlash) { - tail += '\\'; - } - - return device + (isAbsolute ? '\\' : '') + tail; - }; - - //windows version - exports.join = function() { - function f(p) { - return p && typeof p === 'string'; - } - - var _paths = Array.prototype.slice.call(arguments, 0).filter(f); - var joined = _paths.join('\\'); - - // Make sure that the joined path doesn't start with two slashes - // - it will be mistaken for an unc path by normalize() - - // unless the _paths[0] also starts with two slashes - if (/^[\\\/]{2}/.test(joined) && !/^[\\\/]{2}/.test(_paths[0])) { - joined = joined.slice(1); - } - - return exports.normalize(joined); - }; - - // path.relative(from, to) - // it will solve the relative path from 'from' to 'to', for instance: - // from = 'C:\\orandea\\test\\aaa' - // to = 'C:\\orandea\\impl\\bbb' - // The output of the function should be: '..\\..\\impl\\bbb' - // windows version - exports.relative = function(from, to) { - from = exports.resolve(from); - to = exports.resolve(to); - - // windows is not case sensitive - var lowerFrom = from.toLowerCase(); - var lowerTo = to.toLowerCase(); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') { - break; - } - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') { - break; - } - } - - if (start > end) { - return []; - } - return arr.slice(start, end - start + 1); - } - - var toParts = trim(to.split('\\')); - - var lowerFromParts = trim(lowerFrom.split('\\')); - var lowerToParts = trim(lowerTo.split('\\')); - - var length = Math.min(lowerFromParts.length, lowerToParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (lowerFromParts[i] !== lowerToParts[i]) { - samePartsLength = i; - break; - } - } - - if (samePartsLength === 0) { - return to; - } - - var outputParts = []; - for (i = samePartsLength; i < lowerFromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('\\'); - }; -} else { - // path.resolve([from ...], to) - // posix version - exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string' || !path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(resolvedPath.split('/').filter(function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; - }; - - // path.normalize(_path) - // posix version - exports.normalize = function(_path) { - var isAbsolute = _path.charAt(0) === '/', - trailingSlash = _path.slice(-1) === '/'; - - // Normalize the path - _path = normalizeArray(_path.split('/').filter(function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!_path && !isAbsolute) { - _path = '.'; - } - if (_path && trailingSlash) { - _path += '/'; - } - - return (isAbsolute ? '/' : '') + _path; - }; - - // posix version - exports.join = function() { - var _paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(_paths.filter(function(p, index) { - return p && typeof p === 'string'; - }).join('/')); - }; - - // path.relative(from, to) - // posix version - exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') { - break; - } - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') { - break; - } - } - - if (start > end) { - return []; - } - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); - }; -} \ No newline at end of file diff --git a/node_modules/jsdoc/rhino/querystring.js b/node_modules/jsdoc/rhino/querystring.js deleted file mode 100644 index b38921a..0000000 --- a/node_modules/jsdoc/rhino/querystring.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Adapted version of Node.js' `querystring` module. - * @module querystring - * @see http://nodejs.org/api/querystring.html - * @see https://github.com/joyent/node/blob/f105f2f2/lib/querystring.js - * @license MIT - */ -var QueryString = exports; - -// If obj.hasOwnProperty has been overridden, then calling -// obj.hasOwnProperty(prop) will break. -// See: https://github.com/joyent/node/issues/1707 -function hasOwnProp(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - - -QueryString.unescape = function(s) { - return decodeURIComponent(s); -}; - - -QueryString.escape = function(str) { - return encodeURIComponent(str); -}; - -var stringifyPrimitive = function(v) { - switch (typeof v) { - case 'string': - return v; - - case 'boolean': - return v ? 'true' : 'false'; - - case 'number': - return isFinite(v) ? v : ''; - - default: - return ''; - } -}; - - -QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } - - if (typeof obj === 'object') { - return Object.keys(obj).map(function(k) { - var ks = QueryString.escape(stringifyPrimitive(k)) + eq; - if (Array.isArray(obj[k])) { - return obj[k].map(function(v) { - return ks + QueryString.escape(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + QueryString.escape(stringifyPrimitive(obj[k])); - } - }).join(sep); - - } - - if (!name) { - return ''; - } - return QueryString.escape(stringifyPrimitive(name)) + eq + - QueryString.escape(stringifyPrimitive(obj)); -}; - -// Parse a key=val string. -QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = QueryString.unescape(kstr); - v = QueryString.unescape(vstr); - - if (!hasOwnProp(obj, k)) { - obj[k] = v; - } else if (Array.isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; -}; diff --git a/node_modules/jsdoc/rhino/rhino-shim.js b/node_modules/jsdoc/rhino/rhino-shim.js deleted file mode 100644 index 1ffb1e3..0000000 --- a/node_modules/jsdoc/rhino/rhino-shim.js +++ /dev/null @@ -1,126 +0,0 @@ -/*global env: true, Packages: true */ -/** - * @overview A minimal emulation of the standard features of Node.js necessary - * to get JSDoc to run. - */ - -// Set the JS version that the Rhino interpreter will use. -version(180); - -/** - * Emulate DOM timeout/interval functions. - * @see https://developer.mozilla.org/en-US/docs/DOM/window#Methods - */ - -setTimeout = null, -clearTimeout = null, -setInterval = null, -clearInterval = null; - -(function() { - // TODO: tune number of threads if necessary - var timerPool = new java.util.concurrent.ScheduledThreadPoolExecutor(10); - var timers = {}; - var timerCount = 1; - var timerUnits = java.util.concurrent.TimeUnit.MILLISECONDS; - - function getCallback(fn) { - return new java.lang.Runnable({ - run: Packages.org.mozilla.javascript.Context.call(fn) - }); - } - - setTimeout = function(fn, delay) { - var timerId = timerCount++; - var callback = getCallback(fn); - timers[timerId] = timerPool.schedule(callback, delay, timerUnits); - return timerId; - }; - - clearTimeout = function(timerId) { - if (timers[timerId]) { - timerPool.remove(timers[timerId]); - delete timers[timerId]; - } - }; - - setInterval = function(fn, delay) { - var timerId = timerCount++; - var callback = getCallback(fn); - timers[timerId] = timerPool.scheduleAtFixedRate(callback, delay, delay, timerUnits); - return timerId; - }; - - clearInterval = clearTimeout; -})(); - -/** - * Emulate Node.js console functions. - * @see http://nodejs.org/api/stdio.html - */ -console = (function() { - function println(stream, args) { - java.lang.System[stream].println( require('util').format.apply(this, args) ); - } - - return { - error: function() { - println('err', arguments); - }, - info: function() { - println('out', arguments); - }, - log: function() { - println('out', arguments); - }, - trace: function(label) { - // this puts some extra junk at the top of the stack trace, but it's close enough - var e = new java.lang.Exception(label || 'Trace'); - e.printStackTrace(); - }, - warn: function() { - println('err', arguments); - } - }; -})(); - -/** - * Emulate Node.js process functions. - * @see http://nodejs.org/api/process.html - */ -process = { - argv: [__dirname + '/jsdoc.js'].concat(Array.prototype.slice.call(arguments, 0)), - cwd: function() { - return new Packages.java.io.File('.').getCanonicalPath() + ''; - }, - env: (function() { - var result = {}; - - var env = java.lang.System.getenv(); - var keys = env.keySet().toArray(); - var key; - for (var i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - result[key + ''] = env.get(key) + ''; - } - - return result; - })(), - exit: function(n) { - n = n || 0; - java.lang.System.exit(n); - }, - nextTick: function(callback) { - setTimeout(callback, 0); - }, - stderr: { - write: function(str) { - java.lang.System.err.print(str); - } - }, - stdout: { - write: function(str) { - java.lang.System.out.print(str); - } - } -}; diff --git a/node_modules/jsdoc/rhino/util.js b/node_modules/jsdoc/rhino/util.js deleted file mode 100644 index bd69683..0000000 --- a/node_modules/jsdoc/rhino/util.js +++ /dev/null @@ -1,561 +0,0 @@ -/** - * Adapted version of Node.js' `util` module. - * @module util - * @see http://nodejs.org/api/util.html - * @see https://github.com/joyent/node/blob/85090734/lib/util.js - * @license MIT - */ - -function hasOwnProp(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - - -// placate JSHint -var stylizeNoColor, stylizeWithColor, formatValue, formatPrimitive; - -/** - * Echoes the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) { - ctx.depth = arguments[2]; - } - if (arguments.length >= 4) { - ctx.colors = arguments[3]; - } - if (typeof opts === 'boolean') { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (typeof ctx.showHidden === 'undefined') { - ctx.showHidden = false; - } - if (typeof ctx.depth === 'undefined') { - ctx.depth = 2; - } - if (typeof ctx.colors === 'undefined') { - ctx.colors = false; - } - if (typeof ctx.customInspect === 'undefined') { - ctx.customInspect = true; - } - if (ctx.colors) { - ctx.stylize = stylizeWithColor; - } - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -stylizeWithColor = function(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -}; - - -stylizeNoColor = function(str, styleType) { - return str; -}; - - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - var i, len; - - if (typeof f !== 'string') { - var objects = []; - for (i = 0, len = arguments.length; i < len; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - i = 1; - var args = arguments; - len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') { - return '%'; - } - if (i >= len) { - return x; - } - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': return require('jsdoc/util/dumper').dump(args[i++]); - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (x === null || typeof x !== 'object') { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - if (process.noDeprecation === true) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -exports.print = function() { - var args = Array.prototype.slice.call(arguments, 0); - for (var i = 0, len = args.length; i < len; ++i) { - process.stdout.write(String(args[i])); - } -}; - - -exports.puts = function() { - var args = Array.prototype.slice.call(arguments, 0); - for (var i = 0, len = args.length; i < len; ++i) { - process.stdout.write(args[i] + '\n'); - } -}; - - -exports.debug = function(x) { - process.stderr.write('DEBUG: ' + x + '\n'); -}; - - -var error = exports.error = function(x) { - var args = Array.prototype.slice.call(arguments, 0); - for (var i = 0, len = args.length; i < len; ++i) { - process.stderr.write(args[i] + '\n'); - } -}; - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProp(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (recurseTimes === null) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProp(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) { - numLinesEst++; - } - return prev + cur.length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar) || - (typeof ar === 'object' && objectToString(ar) === '[object Array]'); -} -exports.isArray = isArray; - - -function isRegExp(re) { - return typeof re === 'object' && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - - -function isError(e) { - return typeof e === 'object' && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - - -formatValue = function(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return String(value.inspect(recurseTimes)); - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (typeof value === 'function') { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length === 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -}; - - -formatPrimitive = function(ctx, value) { - switch (typeof value) { - case 'undefined': - return ctx.stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - - case 'number': - return ctx.stylize('' + value, 'number'); - - case 'boolean': - return ctx.stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return ctx.stylize('null', 'null'); - } -}; - - -exports.p = exports.deprecate(function() { - var args = Array.prototype.slice.call(arguments, 0); - for (var i = 0, len = args.length; i < len; ++i) { - error(exports.inspect(args[i])); - } -}, 'util.p: Use console.error() instead.'); - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -exports.log = function(msg) { - exports.puts(timestamp() + ' - ' + msg.toString()); -}; - - -exports.exec = function() { - throw new Error('util.exec() is not implemented on Rhino (and was deprecated in Node.js 0.2)'); -}; - - -exports.pump = function() { - throw new Error('util.pump() is not implemented on Rhino (and was deprecated in Node.js 0.8'); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || typeof add !== 'object') { - return origin; - } - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; diff --git a/node_modules/jsdoc/templates/README.md b/node_modules/jsdoc/templates/README.md index 48c0444..7424e74 100644 --- a/node_modules/jsdoc/templates/README.md +++ b/node_modules/jsdoc/templates/README.md @@ -10,7 +10,7 @@ For example: /** * Generate documentation output. - * + * * @param {TAFFY} data - A TaffyDB collection representing * all the symbols documented in your code. * @param {object} opts - An object with options information. diff --git a/node_modules/jsdoc/templates/default/publish.js b/node_modules/jsdoc/templates/default/publish.js index 63a62f9..c7ac385 100644 --- a/node_modules/jsdoc/templates/default/publish.js +++ b/node_modules/jsdoc/templates/default/publish.js @@ -1,19 +1,24 @@ /*global env: true */ -var template = require('jsdoc/template'), - fs = require('jsdoc/fs'), - path = require('jsdoc/path'), - taffy = require('taffydb').taffy, - handle = require('jsdoc/util/error').handle, - helper = require('jsdoc/util/templateHelper'), - htmlsafe = helper.htmlsafe, - linkto = helper.linkto, - resolveAuthorLinks = helper.resolveAuthorLinks, - scopeToPunc = helper.scopeToPunc, - hasOwnProp = Object.prototype.hasOwnProperty, - data, - view, - outdir = env.opts.destination; +'use strict'; +var fs = require('jsdoc/fs'); +var helper = require('jsdoc/util/templateHelper'); +var logger = require('jsdoc/util/logger'); +var path = require('jsdoc/path'); +var taffy = require('taffydb').taffy; +var template = require('jsdoc/template'); +var util = require('util'); + +var htmlsafe = helper.htmlsafe; +var linkto = helper.linkto; +var resolveAuthorLinks = helper.resolveAuthorLinks; +var scopeToPunc = helper.scopeToPunc; +var hasOwnProp = Object.prototype.hasOwnProperty; + +var data; +var view; + +var outdir = env.opts.destination; function find(spec) { return helper.find(data, spec); @@ -29,9 +34,9 @@ function getAncestorLinks(doclet) { function hashToLink(doclet, hash) { if ( !/^(#.+)/.test(hash) ) { return hash; } - + var url = helper.createLink(doclet); - + url = url.replace(/(#.+|$)/, hash); return '' + hash + ''; } @@ -57,63 +62,149 @@ function needsSignature(doclet) { return needsSig; } +function getSignatureAttributes(item) { + var attributes = []; + + if (item.optional) { + attributes.push('opt'); + } + + if (item.nullable === true) { + attributes.push('nullable'); + } + else if (item.nullable === false) { + attributes.push('non-null'); + } + + return attributes; +} + +function updateItemName(item) { + var attributes = getSignatureAttributes(item); + var itemName = item.name || ''; + + if (item.variable) { + itemName = '…' + itemName; + } + + if (attributes && attributes.length) { + itemName = util.format( '%s%s', itemName, + attributes.join(', ') ); + } + + return itemName; +} + +function addParamAttributes(params) { + return params.filter(function(param) { + return param.name && param.name.indexOf('.') === -1; + }).map(updateItemName); +} + +function buildItemTypeStrings(item) { + var types = []; + + if (item.type && item.type.names) { + item.type.names.forEach(function(name) { + types.push( linkto(name, htmlsafe(name)) ); + }); + } + + return types; +} + +function buildAttribsString(attribs) { + var attribsString = ''; + + if (attribs && attribs.length) { + attribsString = htmlsafe( util.format('(%s) ', attribs.join(', ')) ); + } + + return attribsString; +} + +function addNonParamAttributes(items) { + var types = []; + + items.forEach(function(item) { + types = types.concat( buildItemTypeStrings(item) ); + }); + + return types; +} + function addSignatureParams(f) { - var params = helper.getSignatureParams(f, 'optional'); - - f.signature = (f.signature || '') + '('+params.join(', ')+')'; + var params = f.params ? addParamAttributes(f.params) : []; + + f.signature = util.format( '%s(%s)', (f.signature || ''), params.join(', ') ); } function addSignatureReturns(f) { - var returnTypes = helper.getSignatureReturns(f); - + var attribs = []; + var attribsString = ''; + var returnTypes = []; + var returnTypesString = ''; + + // jam all the return-type attributes into an array. this could create odd results (for example, + // if there are both nullable and non-nullable return types), but let's assume that most people + // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa. + if (f.returns) { + f.returns.forEach(function(item) { + helper.getAttribs(item).forEach(function(attrib) { + if (attribs.indexOf(attrib) === -1) { + attribs.push(attrib); + } + }); + }); + + attribsString = buildAttribsString(attribs); + } + + if (f.returns) { + returnTypes = addNonParamAttributes(f.returns); + } + if (returnTypes.length) { + returnTypesString = util.format( ' → %s{%s}', attribsString, returnTypes.join('|') ); + } + f.signature = '' + (f.signature || '') + '' + - '' + - (returnTypes && returnTypes.length ? ' → {' + returnTypes.join('|') + '}' : '') + - ''; + '' + returnTypesString + ''; } function addSignatureTypes(f) { - var types = helper.getSignatureTypes(f); - - f.signature = (f.signature || '') + ''+(types.length? ' :'+types.join('|') : '')+''; + var types = f.type ? buildItemTypeStrings(f) : []; + + f.signature = (f.signature || '') + '' + + (types.length ? ' :' + types.join('|') : '') + ''; } function addAttribs(f) { var attribs = helper.getAttribs(f); - - f.attribs = '' + htmlsafe(attribs.length ? - // we want the template output to say 'abstract', not 'virtual' - '<' + attribs.join(', ').replace('virtual', 'abstract') + '> ' : '') + ''; + var attribsString = buildAttribsString(attribs); + + f.attribs = util.format('%s', attribsString); } function shortenPaths(files, commonPrefix) { - // always use forward slashes - var regexp = new RegExp('\\\\', 'g'); - Object.keys(files).forEach(function(file) { files[file].shortened = files[file].resolved.replace(commonPrefix, '') - .replace(regexp, '/'); + // always use forward slashes + .replace(/\\/g, '/'); }); return files; } -function resolveSourcePath(filepath) { - return path.resolve(process.cwd(), filepath); -} - function getPathFromDoclet(doclet) { if (!doclet.meta) { - return; + return null; } - var filepath = doclet.meta.path && doclet.meta.path !== 'null' ? - doclet.meta.path + '/' + doclet.meta.filename : + return doclet.meta.path && doclet.meta.path !== 'null' ? + path.join(doclet.meta.path, doclet.meta.filename) : doclet.meta.filename; - - return filepath; } - + function generate(title, docs, filename, resolveLinks) { resolveLinks = resolveLinks === false ? false : true; @@ -121,14 +212,14 @@ function generate(title, docs, filename, resolveLinks) { title: title, docs: docs }; - + var outpath = path.join(outdir, filename), html = view.render('container.tmpl', docData); - + if (resolveLinks) { html = helper.resolveLinks(html); // turn {@link foo} into foo } - + fs.writeFileSync(outpath, html, 'utf8'); } @@ -136,7 +227,7 @@ function generateSourceFiles(sourceFiles, encoding) { encoding = encoding || 'utf8'; Object.keys(sourceFiles).forEach(function(file) { var source; - // links are keyed to the shortened path in each doclet's `meta.filename` property + // links are keyed to the shortened path in each doclet's `meta.shortpath` property var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened); helper.registerLink(sourceFiles[file].shortened, sourceOutfile); @@ -147,7 +238,7 @@ function generateSourceFiles(sourceFiles, encoding) { }; } catch(e) { - handle(e); + logger.error('Error while generating source file %s: %s', file, e.message); } generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile, @@ -160,7 +251,7 @@ function generateSourceFiles(sourceFiles, encoding) { * exports only that class or function), then attach the classes or functions to the `module` * property of the appropriate module doclets. The name of each class or function is also updated * for display purposes. This function mutates the original arrays. - * + * * @private * @param {Array.} doclets - The array of classes and functions to * check. @@ -177,7 +268,7 @@ function attachModuleSymbols(doclets, modules) { return modules.map(function(module) { if (symbols[module.longname]) { module.module = symbols[module.longname]; - module.module.name = module.module.name.replace('module:', 'require("') + '")'; + module.module.name = module.module.name.replace('module:', '(require("') + '"))'; } }); } @@ -206,34 +297,34 @@ function buildNav(members) { nav += '

            Modules

              '; members.modules.forEach(function(m) { if ( !hasOwnProp.call(seen, m.longname) ) { - nav += '
            • '+linkto(m.longname, m.name)+'
            • '; + 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, '') )+'
            • '; + 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. '; + classNav += '
          9. ' + linkto(c.longname, c.name) + '
          10. '; } seen[c.longname] = true; }); - + if (classNav !== '') { nav += '

            Classes

              '; nav += classNav; @@ -245,47 +336,47 @@ function buildNav(members) { nav += '

              Events

                '; members.events.forEach(function(e) { if ( !hasOwnProp.call(seen, e.longname) ) { - nav += '
              • '+linkto(e.longname, e.name)+'
              • '; + 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)+'
              • '; + 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)+'
              • '; + 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 += '
              • ' + tutoriallink(t.name) + '
              • '; }); - + nav += '
              '; } - + if (members.globals.length) { members.globals.forEach(function(g) { if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) { @@ -293,7 +384,7 @@ function buildNav(members) { } seen[g.longname] = true; }); - + if (!globalNav) { // turn the heading into a link so you can actually get to the global page nav += '

              ' + linkto('global', 'Global') + '

              '; @@ -306,7 +397,6 @@ function buildNav(members) { return nav; } - /** @param {TAFFY} taffyData See . @param {object} opts @@ -320,7 +410,7 @@ exports.publish = function(taffyData, opts, tutorials) { var templatePath = opts.template; view = new template.Template(templatePath + '/tmpl'); - + // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness // doesn't try to hand them out later var indexUrl = helper.getUniqueFilename('index'); @@ -330,7 +420,10 @@ exports.publish = function(taffyData, opts, tutorials) { helper.registerLink('global', globalUrl); // set up templating - view.layout = 'layout.tmpl'; + view.layout = conf['default'].layoutFile ? + path.getResourcePath(path.dirname(conf['default'].layoutFile), + path.basename(conf['default'].layoutFile) ) : + 'layout.tmpl'; // set up tutorials for helper helper.setTutorials(tutorials); @@ -343,16 +436,16 @@ exports.publish = function(taffyData, opts, tutorials) { var sourceFilePaths = []; data().each(function(doclet) { doclet.attribs = ''; - + if (doclet.examples) { doclet.examples = doclet.examples.map(function(example) { var caption, code; - + if (example.match(/^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) { caption = RegExp.$1; code = RegExp.$3; } - + return { caption: caption || '', code: code || example @@ -367,18 +460,18 @@ exports.publish = function(taffyData, opts, tutorials) { // build a list of source files var sourcePath; - var resolvedSourcePath; if (doclet.meta) { sourcePath = getPathFromDoclet(doclet); - resolvedSourcePath = resolveSourcePath(sourcePath); sourceFiles[sourcePath] = { - resolved: resolvedSourcePath, + resolved: sourcePath, shortened: null }; - sourceFilePaths.push(resolvedSourcePath); + if (sourceFilePaths.indexOf(sourcePath) === -1) { + sourceFilePaths.push(sourcePath); + } } }); - + // update outdir if necessary, then create outdir var packageInfo = ( find({kind: 'package'}) || [] ) [0]; if (packageInfo && packageInfo.name) { @@ -409,15 +502,14 @@ exports.publish = function(taffyData, opts, tutorials) { var extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter); extraStaticFiles.forEach(function(fileName) { - var sourcePath = fs.statSync(filePath).isDirectory() ? filePath : - path.dirname(filePath); + var sourcePath = fs.toDir(filePath); var toDir = fs.toDir( fileName.replace(sourcePath, outdir) ); fs.mkPath(toDir); fs.copyFileSync(fileName, toDir); }); }); } - + if (sourceFilePaths.length) { sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) ); } @@ -425,17 +517,17 @@ exports.publish = function(taffyData, opts, tutorials) { var url = helper.createLink(doclet); helper.registerLink(doclet.longname, url); - // replace the filename with a shortened version of the full path + // add a shortened version of the full path var docletPath; if (doclet.meta) { docletPath = getPathFromDoclet(doclet); docletPath = sourceFiles[docletPath].shortened; if (docletPath) { - doclet.meta.filename = docletPath; + doclet.meta.shortpath = docletPath; } } }); - + data().each(function(doclet) { var url = helper.longnameToUrl[doclet.longname]; @@ -445,14 +537,14 @@ exports.publish = function(taffyData, opts, tutorials) { else { doclet.id = doclet.name; } - + if ( needsSignature(doclet) ) { addSignatureParams(doclet); addSignatureReturns(doclet); addAttribs(doclet); } }); - + // do this after the urls have all been generated data().each(function(doclet) { doclet.ancestors = getAncestorLinks(doclet); @@ -461,37 +553,41 @@ exports.publish = function(taffyData, opts, tutorials) { addSignatureTypes(doclet); addAttribs(doclet); } - + if (doclet.kind === 'constant') { addSignatureTypes(doclet); addAttribs(doclet); doclet.kind = 'member'; } }); - + var members = helper.getMembers(data); members.tutorials = tutorials.children; + // output pretty-printed source files by default + var outputSourceFiles = conf['default'] && conf['default'].outputSourceFiles !== false ? true : + false; + // add template helpers view.find = find; view.linkto = linkto; view.resolveAuthorLinks = resolveAuthorLinks; view.tutoriallink = tutoriallink; view.htmlsafe = htmlsafe; + view.outputSourceFiles = outputSourceFiles; // once for all view.nav = buildNav(members); attachModuleSymbols( find({ kind: ['class', 'function'], longname: {left: 'module:'} }), members.modules ); - // output pretty-printed source files by default; do this before generating any other pages, so - // that the other pages can link to the source files - if (!conf['default'] || conf['default'].outputSourceFiles !== false) { + // generate the pretty-printed source files first so other pages can link to them + if (outputSourceFiles) { generateSourceFiles(sourceFiles, opts.encoding); } if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); } - + // index page displays information from package.json and lists files var files = find({kind: 'file'}), packages = find({kind: 'package'}); @@ -508,13 +604,13 @@ exports.publish = function(taffyData, opts, tutorials) { var namespaces = taffy(members.namespaces); var mixins = taffy(members.mixins); var externals = taffy(members.externals); - + 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]); @@ -524,7 +620,7 @@ exports.publish = function(taffyData, opts, tutorials) { if (myNamespaces.length) { generate('Namespace: ' + myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]); } - + var myMixins = helper.find(mixins, {longname: longname}); if (myMixins.length) { generate('Mixin: ' + myMixins[0].name, myMixins, helper.longnameToUrl[longname]); @@ -544,16 +640,16 @@ exports.publish = function(taffyData, opts, tutorials) { content: tutorial.parse(), children: tutorial.children }; - + var tutorialPath = path.join(outdir, filename), html = view.render('tutorial.tmpl', tutorialData); - + // yes, you can use {@link} in tutorials too! html = helper.resolveLinks(html); // turn {@link foo} into foo - + fs.writeFileSync(tutorialPath, html, 'utf8'); } - + // tutorials can have only one parent so there is no risk for loops function saveChildren(node) { node.children.forEach(function(child) { diff --git a/node_modules/jsdoc/templates/default/static/scripts/linenumber.js b/node_modules/jsdoc/templates/default/static/scripts/linenumber.js index 613865d..8d52f7e 100644 --- a/node_modules/jsdoc/templates/default/static/scripts/linenumber.js +++ b/node_modules/jsdoc/templates/default/static/scripts/linenumber.js @@ -1,17 +1,25 @@ +/*global document */ (function() { - var counter = 0; - var numbered; - var source = document.getElementsByClassName('prettyprint source'); + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; if (source && source[0]) { - source = source[0].getElementsByTagName('code')[0]; + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; - numbered = source.innerHTML.split('\n'); - numbered = numbered.map(function(item) { - counter++; - return '' + item; - }); - - source.innerHTML = numbered.join('\n'); + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } } })(); 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 7afd685..124ef6c 100644 --- a/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css +++ b/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css @@ -6,10 +6,10 @@ html 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: 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; } a { @@ -26,17 +26,17 @@ a:active { header { - display: block; - padding: 6px 4px; + display: block; + padding: 6px 4px; } .class-description { font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; - font-size: 130%; - line-height: 140%; - margin-bottom: 1em; - margin-top: 1em; + font-family: Palatino, 'Palatino Linotype', serif; + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; } #main { @@ -46,10 +46,10 @@ header section { - display: block; - - background-color: #fff; - padding: 12px 24px; + display: block; + + background-color: #fff; + padding: 12px 24px; border-bottom: 1px solid #ccc; margin-right: 240px; } @@ -58,18 +58,17 @@ section display: none; } -.optional:after { - content: "opt"; - font-size: 60%; - color: #aaa; - font-style: italic; - font-weight: lighter; +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; } nav { - display: block; - float: left; + display: block; + float: left; margin-left: -230px; margin-top: 28px; width: 220px; @@ -121,53 +120,53 @@ footer { h1 { - font-size: 200%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 9px 0; + font-size: 200%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 6px 0 9px 0; } h2 { - font-size: 170%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; + 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: 150%; + font-weight: bold; + letter-spacing: -0.01em; + margin-top: 16px; + margin: 6px 0 3px 0; } h4 { - font-size: 130%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 18px 0 3px 0; - color: #A35A00; + font-size: 130%; + font-weight: bold; + letter-spacing: -0.01em; + margin-top: 16px; + margin: 18px 0 3px 0; + color: #A35A00; } h5, .container-overview .subsection-title { - font-size: 120%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 8px 0 3px -16px; + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px -16px; } h6 { - font-size: 100%; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; - font-style: italic; + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; } .ancestors { color: #999; } @@ -179,8 +178,8 @@ h6 .important { - font-weight: bold; - color: #950B02; + font-weight: bold; + color: #950B02; } .yes-def { @@ -192,7 +191,7 @@ h6 } .name, .signature { - font-family: Consolas, "Lucida Console", Monaco, monospace; + font-family: Consolas, "Lucida Console", Monaco, monospace; } .details { margin-top: 14px; border-left: 2px solid #DDD; } @@ -205,23 +204,23 @@ h6 .details .object-value { padding-top: 0; } .description { - margin-bottom: 1em; - margin-left: -16px; - margin-top: 1em; + 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; + font-style: italic; + font-family: Palatino, 'Palatino Linotype', serif; + font-size: 107%; + margin: 0; } .prettyprint { - border: 1px solid #ddd; - width: 80%; + border: 1px solid #ddd; + width: 80%; overflow: auto; } @@ -231,15 +230,14 @@ 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; - border-left: 3px #ddd solid; + 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; } .prettyprint code span.line @@ -247,44 +245,89 @@ h6 display: inline-block; } +.prettyprint.linenums +{ + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol +{ + padding-left: 0; +} + +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; +} + +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; +} + +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + .params, .props { - border-spacing: 0; - border: 0; - border-collapse: collapse; + border-spacing: 0; + border: 0; + border-collapse: collapse; } .params .name, .props .name, .name code { - color: #A35A00; - font-family: Consolas, 'Lucida Console', Monaco, monospace; - font-size: 100%; + color: #A35A00; + font-family: Consolas, 'Lucida Console', Monaco, monospace; + font-size: 100%; } .params td, .params th, .props td, .props th { - border: 1px solid #ddd; - margin: 0px; - text-align: left; - vertical-align: top; - padding: 4px 6px; - display: table-cell; + border: 1px solid #ddd; + margin: 0px; + text-align: left; + vertical-align: top; + padding: 4px 6px; + display: table-cell; } .params thead tr, .props thead tr { - background-color: #ddd; - font-weight: bold; + background-color: #ddd; + font-weight: bold; } .params .params thead tr, .props .props thead tr { - background-color: #fff; - font-weight: bold; + background-color: #fff; + font-weight: bold; } .params th, .props th { border-right: 1px solid #aaa; } .params thead .last, .props thead .last { border-right: 1px solid #ddd; } +.params td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; +} + .disabled { color: #454545; } diff --git a/node_modules/jsdoc/templates/default/tmpl/container.tmpl b/node_modules/jsdoc/templates/default/tmpl/container.tmpl index cd3e5a6..173b043 100644 --- a/node_modules/jsdoc/templates/default/tmpl/container.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/container.tmpl @@ -10,7 +10,7 @@
              - +

              @@ -22,106 +22,118 @@
              -

              +
              - +
              - + - +

              Example 1? 's':'' ?>

              - +

              Extends

              - +
              - +

              Mixes In

              - +
              - +

              Requires

              - +
              - +

              Classes

              - +
              - + + +

              Mixins

              + +
              +
              +
              +
              + +

              Namespaces

              - +
              - +

              Members

              - +
              - +

              Methods

              - +
              - +

              Type Definitions

              - +
              @@ -135,20 +147,20 @@ } }); ?>
              - +

              Events

              - +
              -
              + diff --git a/node_modules/jsdoc/templates/default/tmpl/details.tmpl b/node_modules/jsdoc/templates/default/tmpl/details.tmpl index a18dfdc..1ee86d2 100644 --- a/node_modules/jsdoc/templates/default/tmpl/details.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/details.tmpl @@ -3,8 +3,8 @@ var data = obj; var self = this; var defaultObjectClass = ''; -// Check if the default value is an object, if so, apply code highlighting -if (data.defaultvalue && data.defaultvaluetype === 'object') { +// Check if the default value is an object or array; if so, apply code highlighting +if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvaluetype === 'array')) { data.defaultvalue = "
              " + data.defaultvalue + "
              "; defaultObjectClass = ' class="object-value"'; } @@ -12,20 +12,20 @@ if (data.defaultvalue && data.defaultvaluetype === 'object') {
              - +
              Properties:
              - +
              - + - +
              Version:
              - +
              Since:
              @@ -37,14 +37,14 @@ if (data.defaultvalue && data.defaultvaluetype === 'object') { - +
              Deprecated:
              • Yes
                - +
                Author:
                @@ -53,31 +53,31 @@ if (data.defaultvalue && data.defaultvaluetype === 'object') {
              - + - +
              License:
              - +
              Default Value:
                >
              - - + +
              Source:
              • - , + ,
              - +
              Tutorials:
              @@ -86,7 +86,7 @@ if (data.defaultvalue && data.defaultvaluetype === 'object') {
              - +
              See:
              @@ -95,7 +95,7 @@ if (data.defaultvalue && data.defaultvaluetype === 'object') {
              - +
              To Do:
              diff --git a/node_modules/jsdoc/templates/default/tmpl/examples.tmpl b/node_modules/jsdoc/templates/default/tmpl/examples.tmpl index 23384c9..04d975e 100644 --- a/node_modules/jsdoc/templates/default/tmpl/examples.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/examples.tmpl @@ -1,11 +1,13 @@

              -
              +
              \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/tmpl/layout.tmpl b/node_modules/jsdoc/templates/default/tmpl/layout.tmpl index 827b5ac..92cd6ee 100644 --- a/node_modules/jsdoc/templates/default/tmpl/layout.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/layout.tmpl @@ -3,7 +3,7 @@ JSDoc: <?js= title ?> - +