├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── index.js ├── input ├── test.docx ├── test.xls └── test123.xls ├── node_modules ├── .bin │ ├── _mocha │ └── mocha ├── chai │ ├── .npmignore │ ├── CONTRIBUTING.md │ ├── History.md │ ├── README.md │ ├── ReleaseNotes.md │ ├── bower.json │ ├── chai.js │ ├── index.js │ ├── karma.conf.js │ ├── karma.sauce.js │ ├── lib │ │ ├── chai.js │ │ └── chai │ │ │ ├── assertion.js │ │ │ ├── config.js │ │ │ ├── core │ │ │ └── assertions.js │ │ │ ├── interface │ │ │ ├── assert.js │ │ │ ├── expect.js │ │ │ └── should.js │ │ │ └── utils │ │ │ ├── addChainableMethod.js │ │ │ ├── addMethod.js │ │ │ ├── addProperty.js │ │ │ ├── expectTypes.js │ │ │ ├── flag.js │ │ │ ├── getActual.js │ │ │ ├── getEnumerableProperties.js │ │ │ ├── getMessage.js │ │ │ ├── getName.js │ │ │ ├── getPathInfo.js │ │ │ ├── getPathValue.js │ │ │ ├── getProperties.js │ │ │ ├── hasProperty.js │ │ │ ├── index.js │ │ │ ├── inspect.js │ │ │ ├── objDisplay.js │ │ │ ├── overwriteChainableMethod.js │ │ │ ├── overwriteMethod.js │ │ │ ├── overwriteProperty.js │ │ │ ├── test.js │ │ │ └── transferFlags.js │ ├── node_modules │ │ ├── assertion-error │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── deep-eql │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── karma.conf.js │ │ │ ├── lib │ │ │ │ └── eql.js │ │ │ ├── node_modules │ │ │ │ └── type-detect │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── History.md │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lib │ │ │ │ │ └── type.js │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ └── type-detect │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── README.md │ │ │ ├── ReleaseNotes.md │ │ │ ├── index.js │ │ │ ├── lib │ │ │ └── type.js │ │ │ └── package.json │ ├── package.json │ └── sauce.browsers.js ├── mocha │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── .eslintrc │ │ ├── _mocha │ │ ├── mocha │ │ └── options.js │ ├── images │ │ ├── error.png │ │ └── ok.png │ ├── index.js │ ├── lib │ │ ├── browser │ │ │ ├── debug.js │ │ │ ├── diff.js │ │ │ ├── events.js │ │ │ ├── progress.js │ │ │ └── tty.js │ │ ├── context.js │ │ ├── hook.js │ │ ├── interfaces │ │ │ ├── bdd.js │ │ │ ├── common.js │ │ │ ├── exports.js │ │ │ ├── index.js │ │ │ ├── qunit.js │ │ │ └── tdd.js │ │ ├── mocha.js │ │ ├── ms.js │ │ ├── pending.js │ │ ├── reporters │ │ │ ├── base.js │ │ │ ├── doc.js │ │ │ ├── dot.js │ │ │ ├── html-cov.js │ │ │ ├── html.js │ │ │ ├── index.js │ │ │ ├── json-cov.js │ │ │ ├── json-stream.js │ │ │ ├── json.js │ │ │ ├── landing.js │ │ │ ├── list.js │ │ │ ├── markdown.js │ │ │ ├── min.js │ │ │ ├── nyan.js │ │ │ ├── progress.js │ │ │ ├── spec.js │ │ │ ├── tap.js │ │ │ ├── templates │ │ │ │ ├── coverage.jade │ │ │ │ ├── menu.jade │ │ │ │ ├── script.html │ │ │ │ └── style.html │ │ │ └── xunit.js │ │ ├── runnable.js │ │ ├── runner.js │ │ ├── suite.js │ │ ├── template.html │ │ ├── test.js │ │ └── utils.js │ ├── mocha.css │ ├── mocha.js │ ├── node_modules │ │ ├── .bin │ │ │ ├── jade │ │ │ ├── mkdirp │ │ │ └── supports-color │ │ ├── commander │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── debug │ │ │ ├── .jshintrc │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── Makefile │ │ │ ├── Readme.md │ │ │ ├── bower.json │ │ │ ├── browser.js │ │ │ ├── component.json │ │ │ ├── debug.js │ │ │ ├── node.js │ │ │ ├── node_modules │ │ │ │ └── ms │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── History.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── diff │ │ │ ├── README.md │ │ │ ├── diff.js │ │ │ └── package.json │ │ ├── escape-string-regexp │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── glob │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ ├── g.js │ │ │ │ └── usr-local.js │ │ │ ├── glob.js │ │ │ ├── node_modules │ │ │ │ ├── graceful-fs │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── graceful-fs.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── polyfills.js │ │ │ │ │ └── test │ │ │ │ │ │ ├── open.js │ │ │ │ │ │ └── readdir-sort.js │ │ │ │ ├── inherits │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── inherits.js │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test.js │ │ │ │ └── minimatch │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── minimatch.js │ │ │ │ │ ├── node_modules │ │ │ │ │ ├── lru-cache │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── CONTRIBUTORS │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ └── lru-cache.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── test │ │ │ │ │ │ │ ├── basic.js │ │ │ │ │ │ │ ├── foreach.js │ │ │ │ │ │ │ ├── memory-leak.js │ │ │ │ │ │ │ └── serialize.js │ │ │ │ │ └── sigmund │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── bench.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ ├── sigmund.js │ │ │ │ │ │ └── test │ │ │ │ │ │ └── basic.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ ├── basic.js │ │ │ │ │ ├── brace-expand.js │ │ │ │ │ ├── caching.js │ │ │ │ │ ├── defaults.js │ │ │ │ │ └── extglob-ending-with-state-char.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── 00-setup.js │ │ │ │ ├── bash-comparison.js │ │ │ │ ├── bash-results.json │ │ │ │ ├── cwd-test.js │ │ │ │ ├── globstar-match.js │ │ │ │ ├── mark.js │ │ │ │ ├── nocase-nomagic.js │ │ │ │ ├── pause-resume.js │ │ │ │ ├── root-nomount.js │ │ │ │ ├── root.js │ │ │ │ ├── stat.js │ │ │ │ └── zz-cleanup.js │ │ ├── growl │ │ │ ├── History.md │ │ │ ├── Readme.md │ │ │ ├── lib │ │ │ │ └── growl.js │ │ │ ├── package.json │ │ │ └── test.js │ │ ├── jade │ │ │ ├── .npmignore │ │ │ ├── LICENSE │ │ │ ├── bin │ │ │ │ └── jade │ │ │ ├── index.js │ │ │ ├── jade.js │ │ │ ├── jade.md │ │ │ ├── jade.min.js │ │ │ ├── lib │ │ │ │ ├── compiler.js │ │ │ │ ├── doctypes.js │ │ │ │ ├── filters.js │ │ │ │ ├── inline-tags.js │ │ │ │ ├── jade.js │ │ │ │ ├── lexer.js │ │ │ │ ├── nodes │ │ │ │ │ ├── attrs.js │ │ │ │ │ ├── block-comment.js │ │ │ │ │ ├── block.js │ │ │ │ │ ├── case.js │ │ │ │ │ ├── code.js │ │ │ │ │ ├── comment.js │ │ │ │ │ ├── doctype.js │ │ │ │ │ ├── each.js │ │ │ │ │ ├── filter.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── literal.js │ │ │ │ │ ├── mixin.js │ │ │ │ │ ├── node.js │ │ │ │ │ ├── tag.js │ │ │ │ │ └── text.js │ │ │ │ ├── parser.js │ │ │ │ ├── runtime.js │ │ │ │ ├── self-closing.js │ │ │ │ └── utils.js │ │ │ ├── node_modules │ │ │ │ ├── commander │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── History.md │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── Readme.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lib │ │ │ │ │ │ └── commander.js │ │ │ │ │ └── package.json │ │ │ │ └── mkdirp │ │ │ │ │ ├── .gitignore.orig │ │ │ │ │ ├── .gitignore.rej │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.markdown │ │ │ │ │ ├── examples │ │ │ │ │ ├── pow.js │ │ │ │ │ ├── pow.js.orig │ │ │ │ │ └── pow.js.rej │ │ │ │ │ ├── index.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ ├── chmod.js │ │ │ │ │ ├── clobber.js │ │ │ │ │ ├── mkdirp.js │ │ │ │ │ ├── perm.js │ │ │ │ │ ├── perm_sync.js │ │ │ │ │ ├── race.js │ │ │ │ │ ├── rel.js │ │ │ │ │ ├── sync.js │ │ │ │ │ ├── umask.js │ │ │ │ │ └── umask_sync.js │ │ │ ├── package.json │ │ │ ├── runtime.js │ │ │ ├── runtime.min.js │ │ │ ├── test.jade │ │ │ └── testing │ │ │ │ ├── head.jade │ │ │ │ ├── index.jade │ │ │ │ ├── index.js │ │ │ │ ├── layout.jade │ │ │ │ ├── user.jade │ │ │ │ └── user.js │ │ ├── mkdirp │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── bin │ │ │ │ ├── cmd.js │ │ │ │ └── usage.txt │ │ │ ├── examples │ │ │ │ └── pow.js │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ └── minimist │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── example │ │ │ │ │ └── parse.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── readme.markdown │ │ │ │ │ └── test │ │ │ │ │ ├── dash.js │ │ │ │ │ ├── default_bool.js │ │ │ │ │ ├── dotted.js │ │ │ │ │ ├── long.js │ │ │ │ │ ├── parse.js │ │ │ │ │ ├── parse_modified.js │ │ │ │ │ ├── short.js │ │ │ │ │ └── whitespace.js │ │ │ ├── package.json │ │ │ ├── readme.markdown │ │ │ └── test │ │ │ │ ├── chmod.js │ │ │ │ ├── clobber.js │ │ │ │ ├── mkdirp.js │ │ │ │ ├── opts_fs.js │ │ │ │ ├── opts_fs_sync.js │ │ │ │ ├── perm.js │ │ │ │ ├── perm_sync.js │ │ │ │ ├── race.js │ │ │ │ ├── rel.js │ │ │ │ ├── return.js │ │ │ │ ├── return_sync.js │ │ │ │ ├── root.js │ │ │ │ ├── sync.js │ │ │ │ ├── umask.js │ │ │ │ └── umask_sync.js │ │ └── supports-color │ │ │ ├── cli.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── readme.md │ └── package.json └── sinon │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── Changelog.txt │ ├── LICENSE │ ├── README.md │ ├── lib │ ├── sinon.js │ └── sinon │ │ ├── assert.js │ │ ├── behavior.js │ │ ├── call.js │ │ ├── collection.js │ │ ├── extend.js │ │ ├── format.js │ │ ├── log_error.js │ │ ├── match.js │ │ ├── mock.js │ │ ├── sandbox.js │ │ ├── spy.js │ │ ├── stub.js │ │ ├── test.js │ │ ├── test_case.js │ │ ├── times_in_words.js │ │ ├── typeOf.js │ │ ├── util │ │ ├── core.js │ │ ├── event.js │ │ ├── fake_server.js │ │ ├── fake_server_with_clock.js │ │ ├── fake_timers.js │ │ ├── fake_xdomain_request.js │ │ ├── fake_xml_http_request.js │ │ ├── timers_ie.js │ │ ├── xdr_ie.js │ │ └── xhr_ie.js │ │ └── walk.js │ ├── node_modules │ ├── formatio │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── Readme.md │ │ ├── autolint.js │ │ ├── buster.js │ │ ├── lib │ │ │ └── formatio.js │ │ ├── package.json │ │ └── test │ │ │ └── formatio-test.js │ ├── lolex │ │ ├── .editorconfig │ │ ├── .jslintrc │ │ ├── .min-wd │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Readme.md │ │ ├── lolex.js │ │ ├── package.json │ │ ├── script │ │ │ └── ci-test.sh │ │ ├── src │ │ │ └── lolex.js │ │ └── test │ │ │ └── lolex-test.js │ ├── samsam │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── Readme.md │ │ ├── autolint.js │ │ ├── jsTestDriver.conf │ │ ├── lib │ │ │ └── samsam.js │ │ ├── package.json │ │ └── test │ │ │ └── samsam-test.js │ └── util │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── .zuul.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── node_modules │ │ └── inherits │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── inherits.js │ │ │ ├── inherits_browser.js │ │ │ ├── package.json │ │ │ └── test.js │ │ ├── package.json │ │ ├── support │ │ ├── isBuffer.js │ │ └── isBufferBrowser.js │ │ ├── test │ │ ├── browser │ │ │ ├── inspect.js │ │ │ └── is.js │ │ └── node │ │ │ ├── debug.js │ │ │ ├── format.js │ │ │ ├── inspect.js │ │ │ ├── log.js │ │ │ └── util.js │ │ └── util.js │ ├── package.json │ └── pkg │ ├── sinon-1.16.1.js │ ├── sinon-1.17.0.js │ ├── sinon-1.17.2.js │ ├── sinon-ie-1.16.1.js │ ├── sinon-ie-1.17.0.js │ ├── sinon-ie-1.17.2.js │ ├── sinon-ie.js │ ├── sinon-server-1.16.1.js │ ├── sinon-server-1.17.0.js │ ├── sinon-server-1.17.2.js │ ├── sinon-server.js │ └── sinon.js ├── package.json └── tests ├── doc2html.spec.js ├── doc2pdf.spec.js └── xl2pdf.spec.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | **/*/*.log 5 | input/*.pdf 6 | 7 | # Runtime data 8 | pids 9 | *.pid 10 | *.seed 11 | 12 | # Directory for instrumented libs generated by jscoverage/JSCover 13 | lib-cov 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | 18 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 19 | .grunt 20 | 21 | # node-waf configuration 22 | .lock-wscript 23 | 24 | # Compiled binary addons (http://nodejs.org/api/addons.html) 25 | build/Release 26 | 27 | # Dependency directory 28 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 29 | node_modules 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4.1" 4 | - "4.0" 5 | - "4.2" 6 | - "4.2.3" 7 | - "5.2.0" 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 vworld4u 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #office-converter 2 | 3 | A node module to convert office documents into either PDF or HTML. 4 | 5 | It requires requires [unoconv](https://github.com/dagwieers/unoconv) to be installed and in the PATH. It can convert any office document (doc/docx/xls/xlsx/ppt/pptx) which can be opened in Open Office [Or Libre Office] to either PDF or HTML. 6 | 7 | ##Usage 8 | 9 | ``` 10 | var converter = require('office-converter')(); 11 | converter.generatePdf('input/test.xls', function(err, result) { 12 | // Process result if no error 13 | if (result.status === 0) { 14 | console.log('Output File located at ' + result.outputFile); 15 | } 16 | }); 17 | converter.generateHtml('input/test.docx', function(err, result) { 18 | // Process result if no error 19 | if (result.status === 0) { 20 | console.log('Output File located at ' + result.outputFile); 21 | } 22 | }); 23 | 24 | ``` 25 | 26 | ##How to test? 27 | 28 | There are test cases inside tests folder. You can test using `npm test` to test the package. Tests result in test.pdf inside input folder. 29 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var exec = require('child_process').exec; 4 | 5 | module.exports = function() { 6 | return { 7 | generateHtml: generateHtml, 8 | generatePdf: generatePdf 9 | }; 10 | 11 | function generatePdf (fileName, next) { 12 | return generate(fileName, next, 'pdf'); 13 | } 14 | 15 | function generateHtml(fileName, next) { 16 | return generate(fileName, next, 'pdf'); 17 | } 18 | 19 | function generate(fileName, next, outputType) { 20 | exec('unoconv -f ' + outputType + ' "' + fileName +'"', function (error, stdout, stderr) { 21 | if (error) return next(error); 22 | var outputFile = (fileName.lastIndexOf('.') > -1 ? fileName.substring(0, fileName.lastIndexOf('.')) : fileName) + '.' + outputType; 23 | return next(null, { 24 | status: 0, 25 | outputFile: outputFile 26 | }); 27 | }); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /input/test.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vworld4u/office-converter/b1ea855d0001dc7a5d66343698634dbc06b72c2d/input/test.docx -------------------------------------------------------------------------------- /input/test.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vworld4u/office-converter/b1ea855d0001dc7a5d66343698634dbc06b72c2d/input/test.xls -------------------------------------------------------------------------------- /input/test123.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vworld4u/office-converter/b1ea855d0001dc7a5d66343698634dbc06b72c2d/input/test123.xls -------------------------------------------------------------------------------- /node_modules/.bin/_mocha: -------------------------------------------------------------------------------- 1 | ../mocha/bin/_mocha -------------------------------------------------------------------------------- /node_modules/.bin/mocha: -------------------------------------------------------------------------------- 1 | ../mocha/bin/mocha -------------------------------------------------------------------------------- /node_modules/chai/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | docs/ 3 | test/ 4 | support/ 5 | component.json 6 | components/ 7 | build/ 8 | lib-cov/ 9 | coverage/ 10 | .travis.yml 11 | .mailmap 12 | Makefile 13 | *.swp 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /node_modules/chai/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chai", 3 | "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", 4 | "license": "MIT", 5 | "keywords": [ 6 | "test", 7 | "assertion", 8 | "assert", 9 | "testing", 10 | "chai" 11 | ], 12 | "main": "chai.js", 13 | "ignore": [ 14 | "build", 15 | "components", 16 | "lib", 17 | "node_modules", 18 | "support", 19 | "test", 20 | "index.js", 21 | "Makefile", 22 | ".*" 23 | ], 24 | "dependencies": {}, 25 | "devDependencies": {} 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/chai/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/chai'); 2 | -------------------------------------------------------------------------------- /node_modules/chai/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | frameworks: [ 'mocha' ] 4 | , files: [ 5 | 'chai.js' 6 | , 'test/bootstrap/karma.js' 7 | , 'test/*.js' 8 | ] 9 | , reporters: [ 'progress' ] 10 | , colors: true 11 | , logLevel: config.LOG_INFO 12 | , autoWatch: false 13 | , browsers: [ 'PhantomJS' ] 14 | , browserDisconnectTimeout: 10000 15 | , browserDisconnectTolerance: 2 16 | , browserNoActivityTimeout: 20000 17 | , singleRun: true 18 | }); 19 | 20 | switch (process.env.CHAI_TEST_ENV) { 21 | case 'sauce': 22 | require('./karma.sauce')(config); 23 | break; 24 | default: 25 | // ... 26 | break; 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /node_modules/chai/karma.sauce.js: -------------------------------------------------------------------------------- 1 | var version = require('./package.json').version; 2 | var ts = new Date().getTime(); 3 | 4 | module.exports = function(config) { 5 | var auth; 6 | 7 | try { 8 | auth = require('./test/auth/index'); 9 | } catch(ex) { 10 | auth = {}; 11 | auth.SAUCE_USERNAME = process.env.SAUCE_USERNAME || null; 12 | auth.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY || null; 13 | } 14 | 15 | if (!auth.SAUCE_USERNAME || !auth.SAUCE_ACCESS_KEY) return; 16 | if (process.env.SKIP_SAUCE) return; 17 | 18 | var branch = process.env.TRAVIS_BRANCH || 'local' 19 | var browserConfig = require('./sauce.browsers'); 20 | var browsers = Object.keys(browserConfig); 21 | var tags = [ 'chaijs_' + version, auth.SAUCE_USERNAME + '@' + branch ]; 22 | var tunnel = process.env.TRAVIS_JOB_NUMBER || ts; 23 | 24 | if (process.env.TRAVIS_JOB_NUMBER) { 25 | tags.push('travis@' + process.env.TRAVIS_JOB_NUMBER); 26 | } 27 | 28 | config.browsers = config.browsers.concat(browsers); 29 | config.customLaunchers = browserConfig; 30 | config.reporters.push('saucelabs'); 31 | config.transports = [ 'xhr-polling' ]; 32 | 33 | config.sauceLabs = { 34 | username: auth.SAUCE_USERNAME 35 | , accessKey: auth.SAUCE_ACCESS_KEY 36 | , startConnect: true 37 | , tags: tags 38 | , testName: 'ChaiJS' 39 | , tunnelIdentifier: tunnel 40 | }; 41 | }; 42 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chai 3 | * Copyright(c) 2011-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | var used = [] 8 | , exports = module.exports = {}; 9 | 10 | /*! 11 | * Chai version 12 | */ 13 | 14 | exports.version = '3.4.1'; 15 | 16 | /*! 17 | * Assertion Error 18 | */ 19 | 20 | exports.AssertionError = require('assertion-error'); 21 | 22 | /*! 23 | * Utils for plugins (not exported) 24 | */ 25 | 26 | var util = require('./chai/utils'); 27 | 28 | /** 29 | * # .use(function) 30 | * 31 | * Provides a way to extend the internals of Chai 32 | * 33 | * @param {Function} 34 | * @returns {this} for chaining 35 | * @api public 36 | */ 37 | 38 | exports.use = function (fn) { 39 | if (!~used.indexOf(fn)) { 40 | fn(this, util); 41 | used.push(fn); 42 | } 43 | 44 | return this; 45 | }; 46 | 47 | /*! 48 | * Utility Functions 49 | */ 50 | 51 | exports.util = util; 52 | 53 | /*! 54 | * Configuration 55 | */ 56 | 57 | var config = require('./chai/config'); 58 | exports.config = config; 59 | 60 | /*! 61 | * Primary `Assertion` prototype 62 | */ 63 | 64 | var assertion = require('./chai/assertion'); 65 | exports.use(assertion); 66 | 67 | /*! 68 | * Core Assertions 69 | */ 70 | 71 | var core = require('./chai/core/assertions'); 72 | exports.use(core); 73 | 74 | /*! 75 | * Expect interface 76 | */ 77 | 78 | var expect = require('./chai/interface/expect'); 79 | exports.use(expect); 80 | 81 | /*! 82 | * Should interface 83 | */ 84 | 85 | var should = require('./chai/interface/should'); 86 | exports.use(should); 87 | 88 | /*! 89 | * Assert interface 90 | */ 91 | 92 | var assert = require('./chai/interface/assert'); 93 | exports.use(assert); 94 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 3 | /** 4 | * ### config.includeStack 5 | * 6 | * User configurable property, influences whether stack trace 7 | * is included in Assertion error message. Default of false 8 | * suppresses stack trace in the error message. 9 | * 10 | * chai.config.includeStack = true; // enable stack on error 11 | * 12 | * @param {Boolean} 13 | * @api public 14 | */ 15 | 16 | includeStack: false, 17 | 18 | /** 19 | * ### config.showDiff 20 | * 21 | * User configurable property, influences whether or not 22 | * the `showDiff` flag should be included in the thrown 23 | * AssertionErrors. `false` will always be `false`; `true` 24 | * will be true when the assertion has requested a diff 25 | * be shown. 26 | * 27 | * @param {Boolean} 28 | * @api public 29 | */ 30 | 31 | showDiff: true, 32 | 33 | /** 34 | * ### config.truncateThreshold 35 | * 36 | * User configurable property, sets length threshold for actual and 37 | * expected values in assertion errors. If this threshold is exceeded, for 38 | * example for large data structures, the value is replaced with something 39 | * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. 40 | * 41 | * Set it to zero if you want to disable truncating altogether. 42 | * 43 | * This is especially userful when doing assertions on arrays: having this 44 | * set to a reasonable large value makes the failure messages readily 45 | * inspectable. 46 | * 47 | * chai.config.truncateThreshold = 0; // disable truncating 48 | * 49 | * @param {Number} 50 | * @api public 51 | */ 52 | 53 | truncateThreshold: 40 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/interface/expect.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chai 3 | * Copyright(c) 2011-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | module.exports = function (chai, util) { 8 | chai.expect = function (val, message) { 9 | return new chai.Assertion(val, message); 10 | }; 11 | 12 | /** 13 | * ### .fail(actual, expected, [message], [operator]) 14 | * 15 | * Throw a failure. 16 | * 17 | * @name fail 18 | * @param {Mixed} actual 19 | * @param {Mixed} expected 20 | * @param {String} message 21 | * @param {String} operator 22 | * @api public 23 | */ 24 | 25 | chai.expect.fail = function (actual, expected, message, operator) { 26 | message = message || 'expect.fail()'; 27 | throw new chai.AssertionError(message, { 28 | actual: actual 29 | , expected: expected 30 | , operator: operator 31 | }, chai.expect.fail); 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/addMethod.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - addMethod utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | var config = require('../config'); 8 | 9 | /** 10 | * ### .addMethod (ctx, name, method) 11 | * 12 | * Adds a method to the prototype of an object. 13 | * 14 | * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) { 15 | * var obj = utils.flag(this, 'object'); 16 | * new chai.Assertion(obj).to.be.equal(str); 17 | * }); 18 | * 19 | * Can also be accessed directly from `chai.Assertion`. 20 | * 21 | * chai.Assertion.addMethod('foo', fn); 22 | * 23 | * Then can be used as any other assertion. 24 | * 25 | * expect(fooStr).to.be.foo('bar'); 26 | * 27 | * @param {Object} ctx object to which the method is added 28 | * @param {String} name of method to add 29 | * @param {Function} method function to be used for name 30 | * @name addMethod 31 | * @api public 32 | */ 33 | var flag = require('./flag'); 34 | 35 | module.exports = function (ctx, name, method) { 36 | ctx[name] = function () { 37 | var old_ssfi = flag(this, 'ssfi'); 38 | if (old_ssfi && config.includeStack === false) 39 | flag(this, 'ssfi', ctx[name]); 40 | var result = method.apply(this, arguments); 41 | return result === undefined ? this : result; 42 | }; 43 | }; 44 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/addProperty.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - addProperty utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | var config = require('../config'); 8 | var flag = require('./flag'); 9 | 10 | /** 11 | * ### addProperty (ctx, name, getter) 12 | * 13 | * Adds a property to the prototype of an object. 14 | * 15 | * utils.addProperty(chai.Assertion.prototype, 'foo', function () { 16 | * var obj = utils.flag(this, 'object'); 17 | * new chai.Assertion(obj).to.be.instanceof(Foo); 18 | * }); 19 | * 20 | * Can also be accessed directly from `chai.Assertion`. 21 | * 22 | * chai.Assertion.addProperty('foo', fn); 23 | * 24 | * Then can be used as any other assertion. 25 | * 26 | * expect(myFoo).to.be.foo; 27 | * 28 | * @param {Object} ctx object to which the property is added 29 | * @param {String} name of property to add 30 | * @param {Function} getter function to be used for name 31 | * @name addProperty 32 | * @api public 33 | */ 34 | 35 | module.exports = function (ctx, name, getter) { 36 | Object.defineProperty(ctx, name, 37 | { get: function addProperty() { 38 | var old_ssfi = flag(this, 'ssfi'); 39 | if (old_ssfi && config.includeStack === false) 40 | flag(this, 'ssfi', addProperty); 41 | 42 | var result = getter.call(this); 43 | return result === undefined ? this : result; 44 | } 45 | , configurable: true 46 | }); 47 | }; 48 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/expectTypes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - expectTypes utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### expectTypes(obj, types) 9 | * 10 | * Ensures that the object being tested against is of a valid type. 11 | * 12 | * utils.expectTypes(this, ['array', 'object', 'string']); 13 | * 14 | * @param {Mixed} obj constructed Assertion 15 | * @param {Array} type A list of allowed types for this assertion 16 | * @name expectTypes 17 | * @api public 18 | */ 19 | 20 | var AssertionError = require('assertion-error'); 21 | var flag = require('./flag'); 22 | var type = require('type-detect'); 23 | 24 | module.exports = function (obj, types) { 25 | var obj = flag(obj, 'object'); 26 | types = types.map(function (t) { return t.toLowerCase(); }); 27 | types.sort(); 28 | 29 | // Transforms ['lorem', 'ipsum'] into 'a lirum, or an ipsum' 30 | var str = types.map(function (t, index) { 31 | var art = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(t.charAt(0)) ? 'an' : 'a'; 32 | var or = types.length > 1 && index === types.length - 1 ? 'or ' : ''; 33 | return or + art + ' ' + t; 34 | }).join(', '); 35 | 36 | if (!types.some(function (expected) { return type(obj) === expected; })) { 37 | throw new AssertionError( 38 | 'object tested must be ' + str + ', but ' + type(obj) + ' given' 39 | ); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/flag.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - flag utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### flag(object, key, [value]) 9 | * 10 | * Get or set a flag value on an object. If a 11 | * value is provided it will be set, else it will 12 | * return the currently set value or `undefined` if 13 | * the value is not set. 14 | * 15 | * utils.flag(this, 'foo', 'bar'); // setter 16 | * utils.flag(this, 'foo'); // getter, returns `bar` 17 | * 18 | * @param {Object} object constructed Assertion 19 | * @param {String} key 20 | * @param {Mixed} value (optional) 21 | * @name flag 22 | * @api private 23 | */ 24 | 25 | module.exports = function (obj, key, value) { 26 | var flags = obj.__flags || (obj.__flags = Object.create(null)); 27 | if (arguments.length === 3) { 28 | flags[key] = value; 29 | } else { 30 | return flags[key]; 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/getActual.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getActual utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * # getActual(object, [actual]) 9 | * 10 | * Returns the `actual` value for an Assertion 11 | * 12 | * @param {Object} object (constructed Assertion) 13 | * @param {Arguments} chai.Assertion.prototype.assert arguments 14 | */ 15 | 16 | module.exports = function (obj, args) { 17 | return args.length > 4 ? args[4] : obj._obj; 18 | }; 19 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/getEnumerableProperties.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getEnumerableProperties utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### .getEnumerableProperties(object) 9 | * 10 | * This allows the retrieval of enumerable property names of an object, 11 | * inherited or not. 12 | * 13 | * @param {Object} object 14 | * @returns {Array} 15 | * @name getEnumerableProperties 16 | * @api public 17 | */ 18 | 19 | module.exports = function getEnumerableProperties(object) { 20 | var result = []; 21 | for (var name in object) { 22 | result.push(name); 23 | } 24 | return result; 25 | }; 26 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/getMessage.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - message composition utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Module dependancies 9 | */ 10 | 11 | var flag = require('./flag') 12 | , getActual = require('./getActual') 13 | , inspect = require('./inspect') 14 | , objDisplay = require('./objDisplay'); 15 | 16 | /** 17 | * ### .getMessage(object, message, negateMessage) 18 | * 19 | * Construct the error message based on flags 20 | * and template tags. Template tags will return 21 | * a stringified inspection of the object referenced. 22 | * 23 | * Message template tags: 24 | * - `#{this}` current asserted object 25 | * - `#{act}` actual value 26 | * - `#{exp}` expected value 27 | * 28 | * @param {Object} object (constructed Assertion) 29 | * @param {Arguments} chai.Assertion.prototype.assert arguments 30 | * @name getMessage 31 | * @api public 32 | */ 33 | 34 | module.exports = function (obj, args) { 35 | var negate = flag(obj, 'negate') 36 | , val = flag(obj, 'object') 37 | , expected = args[3] 38 | , actual = getActual(obj, args) 39 | , msg = negate ? args[2] : args[1] 40 | , flagMsg = flag(obj, 'message'); 41 | 42 | if(typeof msg === "function") msg = msg(); 43 | msg = msg || ''; 44 | msg = msg 45 | .replace(/#{this}/g, objDisplay(val)) 46 | .replace(/#{act}/g, objDisplay(actual)) 47 | .replace(/#{exp}/g, objDisplay(expected)); 48 | 49 | return flagMsg ? flagMsg + ': ' + msg : msg; 50 | }; 51 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/getName.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getName utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * # getName(func) 9 | * 10 | * Gets the name of a function, in a cross-browser way. 11 | * 12 | * @param {Function} a function (usually a constructor) 13 | */ 14 | 15 | module.exports = function (func) { 16 | if (func.name) return func.name; 17 | 18 | var match = /^\s?function ([^(]*)\(/.exec(func); 19 | return match && match[1] ? match[1] : ""; 20 | }; 21 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/getPathValue.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getPathValue utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * @see https://github.com/logicalparadox/filtr 5 | * MIT Licensed 6 | */ 7 | 8 | var getPathInfo = require('./getPathInfo'); 9 | 10 | /** 11 | * ### .getPathValue(path, object) 12 | * 13 | * This allows the retrieval of values in an 14 | * object given a string path. 15 | * 16 | * var obj = { 17 | * prop1: { 18 | * arr: ['a', 'b', 'c'] 19 | * , str: 'Hello' 20 | * } 21 | * , prop2: { 22 | * arr: [ { nested: 'Universe' } ] 23 | * , str: 'Hello again!' 24 | * } 25 | * } 26 | * 27 | * The following would be the results. 28 | * 29 | * getPathValue('prop1.str', obj); // Hello 30 | * getPathValue('prop1.att[2]', obj); // b 31 | * getPathValue('prop2.arr[0].nested', obj); // Universe 32 | * 33 | * @param {String} path 34 | * @param {Object} object 35 | * @returns {Object} value or `undefined` 36 | * @name getPathValue 37 | * @api public 38 | */ 39 | module.exports = function(path, obj) { 40 | var info = getPathInfo(path, obj); 41 | return info.value; 42 | }; 43 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/getProperties.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getProperties utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### .getProperties(object) 9 | * 10 | * This allows the retrieval of property names of an object, enumerable or not, 11 | * inherited or not. 12 | * 13 | * @param {Object} object 14 | * @returns {Array} 15 | * @name getProperties 16 | * @api public 17 | */ 18 | 19 | module.exports = function getProperties(object) { 20 | var result = Object.getOwnPropertyNames(object); 21 | 22 | function addProperty(property) { 23 | if (result.indexOf(property) === -1) { 24 | result.push(property); 25 | } 26 | } 27 | 28 | var proto = Object.getPrototypeOf(object); 29 | while (proto !== null) { 30 | Object.getOwnPropertyNames(proto).forEach(addProperty); 31 | proto = Object.getPrototypeOf(proto); 32 | } 33 | 34 | return result; 35 | }; 36 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/objDisplay.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - flag utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Module dependancies 9 | */ 10 | 11 | var inspect = require('./inspect'); 12 | var config = require('../config'); 13 | 14 | /** 15 | * ### .objDisplay (object) 16 | * 17 | * Determines if an object or an array matches 18 | * criteria to be inspected in-line for error 19 | * messages or should be truncated. 20 | * 21 | * @param {Mixed} javascript object to inspect 22 | * @name objDisplay 23 | * @api public 24 | */ 25 | 26 | module.exports = function (obj) { 27 | var str = inspect(obj) 28 | , type = Object.prototype.toString.call(obj); 29 | 30 | if (config.truncateThreshold && str.length >= config.truncateThreshold) { 31 | if (type === '[object Function]') { 32 | return !obj.name || obj.name === '' 33 | ? '[Function]' 34 | : '[Function: ' + obj.name + ']'; 35 | } else if (type === '[object Array]') { 36 | return '[ Array(' + obj.length + ') ]'; 37 | } else if (type === '[object Object]') { 38 | var keys = Object.keys(obj) 39 | , kstr = keys.length > 2 40 | ? keys.splice(0, 2).join(', ') + ', ...' 41 | : keys.join(', '); 42 | return '{ Object (' + kstr + ') }'; 43 | } else { 44 | return str; 45 | } 46 | } else { 47 | return str; 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/overwriteMethod.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - overwriteMethod utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### overwriteMethod (ctx, name, fn) 9 | * 10 | * Overwites an already existing method and provides 11 | * access to previous function. Must return function 12 | * to be used for name. 13 | * 14 | * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) { 15 | * return function (str) { 16 | * var obj = utils.flag(this, 'object'); 17 | * if (obj instanceof Foo) { 18 | * new chai.Assertion(obj.value).to.equal(str); 19 | * } else { 20 | * _super.apply(this, arguments); 21 | * } 22 | * } 23 | * }); 24 | * 25 | * Can also be accessed directly from `chai.Assertion`. 26 | * 27 | * chai.Assertion.overwriteMethod('foo', fn); 28 | * 29 | * Then can be used as any other assertion. 30 | * 31 | * expect(myFoo).to.equal('bar'); 32 | * 33 | * @param {Object} ctx object whose method is to be overwritten 34 | * @param {String} name of method to overwrite 35 | * @param {Function} method function that returns a function to be used for name 36 | * @name overwriteMethod 37 | * @api public 38 | */ 39 | 40 | module.exports = function (ctx, name, method) { 41 | var _method = ctx[name] 42 | , _super = function () { return this; }; 43 | 44 | if (_method && 'function' === typeof _method) 45 | _super = _method; 46 | 47 | ctx[name] = function () { 48 | var result = method(_super).apply(this, arguments); 49 | return result === undefined ? this : result; 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/overwriteProperty.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - overwriteProperty utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### overwriteProperty (ctx, name, fn) 9 | * 10 | * Overwites an already existing property getter and provides 11 | * access to previous value. Must return function to use as getter. 12 | * 13 | * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) { 14 | * return function () { 15 | * var obj = utils.flag(this, 'object'); 16 | * if (obj instanceof Foo) { 17 | * new chai.Assertion(obj.name).to.equal('bar'); 18 | * } else { 19 | * _super.call(this); 20 | * } 21 | * } 22 | * }); 23 | * 24 | * 25 | * Can also be accessed directly from `chai.Assertion`. 26 | * 27 | * chai.Assertion.overwriteProperty('foo', fn); 28 | * 29 | * Then can be used as any other assertion. 30 | * 31 | * expect(myFoo).to.be.ok; 32 | * 33 | * @param {Object} ctx object whose property is to be overwritten 34 | * @param {String} name of property to overwrite 35 | * @param {Function} getter function that returns a getter function to be used for name 36 | * @name overwriteProperty 37 | * @api public 38 | */ 39 | 40 | module.exports = function (ctx, name, getter) { 41 | var _get = Object.getOwnPropertyDescriptor(ctx, name) 42 | , _super = function () {}; 43 | 44 | if (_get && 'function' === typeof _get.get) 45 | _super = _get.get 46 | 47 | Object.defineProperty(ctx, name, 48 | { get: function () { 49 | var result = getter(_super).call(this); 50 | return result === undefined ? this : result; 51 | } 52 | , configurable: true 53 | }); 54 | }; 55 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/test.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - test utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Module dependancies 9 | */ 10 | 11 | var flag = require('./flag'); 12 | 13 | /** 14 | * # test(object, expression) 15 | * 16 | * Test and object for expression. 17 | * 18 | * @param {Object} object (constructed Assertion) 19 | * @param {Arguments} chai.Assertion.prototype.assert arguments 20 | */ 21 | 22 | module.exports = function (obj, args) { 23 | var negate = flag(obj, 'negate') 24 | , expr = args[0]; 25 | return negate ? !expr : expr; 26 | }; 27 | -------------------------------------------------------------------------------- /node_modules/chai/lib/chai/utils/transferFlags.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - transferFlags utility 3 | * Copyright(c) 2012-2014 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### transferFlags(assertion, object, includeAll = true) 9 | * 10 | * Transfer all the flags for `assertion` to `object`. If 11 | * `includeAll` is set to `false`, then the base Chai 12 | * assertion flags (namely `object`, `ssfi`, and `message`) 13 | * will not be transferred. 14 | * 15 | * 16 | * var newAssertion = new Assertion(); 17 | * utils.transferFlags(assertion, newAssertion); 18 | * 19 | * var anotherAsseriton = new Assertion(myObj); 20 | * utils.transferFlags(assertion, anotherAssertion, false); 21 | * 22 | * @param {Assertion} assertion the assertion to transfer the flags from 23 | * @param {Object} object the object to transfer the flags to; usually a new assertion 24 | * @param {Boolean} includeAll 25 | * @name transferFlags 26 | * @api private 27 | */ 28 | 29 | module.exports = function (assertion, object, includeAll) { 30 | var flags = assertion.__flags || (assertion.__flags = Object.create(null)); 31 | 32 | if (!object.__flags) { 33 | object.__flags = Object.create(null); 34 | } 35 | 36 | includeAll = arguments.length === 3 ? includeAll : true; 37 | 38 | for (var flag in flags) { 39 | if (includeAll || 40 | (flag !== 'object' && flag !== 'ssfi' && flag != 'message')) { 41 | object.__flags[flag] = flags[flag]; 42 | } 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/assertion-error/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | test/ 3 | build/ 4 | components/ 5 | support/ 6 | coverage.html 7 | component.json 8 | lib-cov 9 | .travis.yml 10 | Makefile 11 | *.swp 12 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/assertion-error/History.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2015-03-04 2 | ================== 3 | 4 | * Merge pull request #2 from simonzack/master 5 | * fixes `.stack` on firefox 6 | 7 | 1.0.0 / 2013-06-08 8 | ================== 9 | 10 | * readme: change travis and component urls 11 | * refactor: [*] prepare for move to chaijs gh org 12 | 13 | 0.1.0 / 2013-04-07 14 | ================== 15 | 16 | * test: use vanilla test runner/assert 17 | * pgk: remove unused deps 18 | * lib: implement 19 | * "Initial commit" 20 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | test/ 3 | build/ 4 | components/ 5 | support/ 6 | coverage.html 7 | component.json 8 | lib-cov 9 | .travis.yml 10 | Makefile 11 | *.swp 12 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.1.3 / 2013-10-10 3 | ================== 4 | 5 | * pkg: update type-detect version 6 | * index,test: conditional require in test bootstrap 7 | 8 | 0.1.2 / 2013-09-18 9 | ================== 10 | 11 | * bug: [fix] misnamed variable from code migration (reference error) 12 | 13 | 0.1.1 / 2013-09-18 14 | ================== 15 | 16 | * bug: [fix] last key of deep object ignored 17 | 18 | 0.1.0 / 2013-09-18 19 | ================== 20 | 21 | * tests: add iterable 22 | * docs: readme 23 | * makefile: [ci] update cov handling 24 | * testing: [env] use karma for phantom 25 | * add tests (uncompleted) 26 | * add library 27 | * add dependencies 28 | * "Initial commit" 29 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/eql'); 2 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | basePath: '' 4 | , frameworks: [ 'mocha' ] 5 | , files: [ 6 | 'build/build.js' 7 | , 'test/bootstrap/karma.js' 8 | , 'test/*.js' 9 | ] 10 | , exclude: [] 11 | , reporters: [ 'progress' ] 12 | , port: 9876 13 | , colors: true 14 | , logLevel: config.LOG_INFO 15 | , autoWatch: true 16 | , browsers: [ 'PhantomJS' ] 17 | , captureTimeout: 60000 18 | , singleRun: false 19 | }); 20 | }; 21 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/node_modules/type-detect/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | test/ 3 | build/ 4 | components/ 5 | support/ 6 | coverage.html 7 | component.json 8 | lib-cov 9 | .travis.yml 10 | Makefile 11 | *.swp 12 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/node_modules/type-detect/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.1.1 / 2013-10-10 3 | ================== 4 | 5 | * Merge pull request #2 from strongloop/fix-browserify 6 | * index,test: support browserify 7 | 8 | 0.1.0 / 2013-08-14 9 | ================== 10 | 11 | * readme: document all methods 12 | * readme: add badges 13 | * library: [test] ensure test runs 14 | * travis: change script to run coveralls reportwq 15 | * tests: add tests 16 | * lib: add type detect lib 17 | * pkg: prepare for coverage based tests 18 | * "Initial commit" 19 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/deep-eql/node_modules/type-detect/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/type'); 2 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/type-detect/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | test/ 3 | build/ 4 | components/ 5 | support/ 6 | coverage.html 7 | component.json 8 | lib-cov 9 | .travis.yml 10 | Makefile 11 | *.swp 12 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/type-detect/ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | ## 1.0.0 / 2015-03-15 4 | 5 | Supports all new ES6 primitives, as well as Objects which override their 6 | toStringTag using [`Symbol.toStringTag`][1]. 7 | 8 | Supports primitive Object instances over literals - for example 9 | `new String('foo')` and `'foo'` both report a type of `'string'`. 10 | 11 | [1]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Well-known_symbols 12 | 13 | ### Community Contributions 14 | 15 | #### Code Features & Fixes 16 | 17 | * [#4](https://github.com/chaijs/chai/pull/4) Included support for ECMA6 types 18 | ([chai/chaijs#394](https://github.com/chaijs/chai/issues/394)). 19 | By [@Charminbear](https://github.com/Charminbear) 20 | 21 | * [#5](https://github.com/chaijs/chai/pull/5) "new String()" as 'string' 22 | instead of 'object'. By [@Charminbear](https://github.com/Charminbear) 23 | 24 | ## 0.1.2 / 2013-11-30 25 | 26 | Support calling the library without the `new` keyword. 27 | 28 | #### Code Features & Fixes 29 | 30 | * Library: constructor with new 31 | By [@logicalparadox](https://github.com/logicalparadox) 32 | 33 | ## 0.1.1 / 2013-10-10 34 | 35 | Add support for browserify. 36 | 37 | #### Code Features & Fixes 38 | 39 | * [#2](https://github.com/chaijs/chai/pull/2) Add support for Browserify 40 | ([#1](https://github.com/chaijs/type-detect/issues/1)). 41 | By [@bajtos](https://github.com/bajtos) 42 | 43 | 44 | ## 0.1.0 / 2013-08-14 45 | 46 | Initial Release 47 | -------------------------------------------------------------------------------- /node_modules/chai/node_modules/type-detect/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/type'); 2 | -------------------------------------------------------------------------------- /node_modules/mocha/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2011-2015 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/mocha/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://api.travis-ci.org/mochajs/mocha.svg?branch=master)](http://travis-ci.org/mochajs/mocha) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mochajs/mocha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 2 | 3 | [![Mocha test framework](http://f.cl.ly/items/3l1k0n2A1U3M1I1L210p/Screen%20Shot%202012-02-24%20at%202.21.43%20PM.png)](http://mochajs.org) 4 | 5 | Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://mochajs.org). 6 | 7 | ## Links 8 | 9 | - [Google Group](http://groups.google.com/group/mochajs) 10 | - [Wiki](https://github.com/mochajs/mocha/wiki) 11 | - Mocha [Extensions and reporters](https://github.com/mochajs/mocha/wiki) 12 | -------------------------------------------------------------------------------- /node_modules/mocha/bin/.eslintrc: -------------------------------------------------------------------------------- 1 | --- 2 | rules: 3 | no-process-exit: 0 4 | -------------------------------------------------------------------------------- /node_modules/mocha/bin/options.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Dependencies. 3 | */ 4 | 5 | var fs = require('fs'); 6 | 7 | /** 8 | * Export `getOptions`. 9 | */ 10 | 11 | module.exports = getOptions; 12 | 13 | /** 14 | * Get options. 15 | */ 16 | 17 | function getOptions() { 18 | var optsPath = process.argv.indexOf('--opts') !== -1 19 | ? process.argv[process.argv.indexOf('--opts') + 1] 20 | : 'test/mocha.opts'; 21 | 22 | try { 23 | var opts = fs.readFileSync(optsPath, 'utf8') 24 | .replace(/\\\s/g, '%20') 25 | .split(/\s/) 26 | .filter(Boolean) 27 | .map(function(value) { 28 | return value.replace(/%20/g, ' '); 29 | }); 30 | 31 | process.argv = process.argv 32 | .slice(0, 2) 33 | .concat(opts.concat(process.argv.slice(2))); 34 | } catch (err) { 35 | // ignore 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/mocha/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vworld4u/office-converter/b1ea855d0001dc7a5d66343698634dbc06b72c2d/node_modules/mocha/images/error.png -------------------------------------------------------------------------------- /node_modules/mocha/images/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vworld4u/office-converter/b1ea855d0001dc7a5d66343698634dbc06b72c2d/node_modules/mocha/images/ok.png -------------------------------------------------------------------------------- /node_modules/mocha/index.js: -------------------------------------------------------------------------------- 1 | module.exports = process.env.COV 2 | ? require('./lib-cov/mocha') 3 | : require('./lib/mocha'); 4 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/browser/debug.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | module.exports = function(type) { 3 | return function() {}; 4 | }; 5 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/browser/tty.js: -------------------------------------------------------------------------------- 1 | exports.isatty = function isatty() { 2 | return true; 3 | }; 4 | 5 | exports.getWindowSize = function getWindowSize() { 6 | if ('innerHeight' in global) { 7 | return [global.innerHeight, global.innerWidth]; 8 | } 9 | // In a Web Worker, the DOM Window is not available. 10 | return [640, 480]; 11 | }; 12 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/hook.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Runnable = require('./runnable'); 6 | var inherits = require('./utils').inherits; 7 | 8 | /** 9 | * Expose `Hook`. 10 | */ 11 | 12 | module.exports = Hook; 13 | 14 | /** 15 | * Initialize a new `Hook` with the given `title` and callback `fn`. 16 | * 17 | * @param {String} title 18 | * @param {Function} fn 19 | * @api private 20 | */ 21 | function Hook(title, fn) { 22 | Runnable.call(this, title, fn); 23 | this.type = 'hook'; 24 | } 25 | 26 | /** 27 | * Inherit from `Runnable.prototype`. 28 | */ 29 | inherits(Hook, Runnable); 30 | 31 | /** 32 | * Get or set the test `err`. 33 | * 34 | * @param {Error} err 35 | * @return {Error} 36 | * @api public 37 | */ 38 | Hook.prototype.error = function(err) { 39 | if (!arguments.length) { 40 | err = this._error; 41 | this._error = null; 42 | return err; 43 | } 44 | 45 | this._error = err; 46 | }; 47 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/interfaces/exports.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Suite = require('../suite'); 6 | var Test = require('../test'); 7 | 8 | /** 9 | * TDD-style interface: 10 | * 11 | * exports.Array = { 12 | * '#indexOf()': { 13 | * 'should return -1 when the value is not present': function() { 14 | * 15 | * }, 16 | * 17 | * 'should return the correct index when the value is present': function() { 18 | * 19 | * } 20 | * } 21 | * }; 22 | * 23 | * @param {Suite} suite Root suite. 24 | */ 25 | module.exports = function(suite) { 26 | var suites = [suite]; 27 | 28 | suite.on('require', visit); 29 | 30 | function visit(obj, file) { 31 | var suite; 32 | for (var key in obj) { 33 | if (typeof obj[key] === 'function') { 34 | var fn = obj[key]; 35 | switch (key) { 36 | case 'before': 37 | suites[0].beforeAll(fn); 38 | break; 39 | case 'after': 40 | suites[0].afterAll(fn); 41 | break; 42 | case 'beforeEach': 43 | suites[0].beforeEach(fn); 44 | break; 45 | case 'afterEach': 46 | suites[0].afterEach(fn); 47 | break; 48 | default: 49 | var test = new Test(key, fn); 50 | test.file = file; 51 | suites[0].addTest(test); 52 | } 53 | } else { 54 | suite = Suite.create(suites[0], key); 55 | suites.unshift(suite); 56 | visit(obj[key]); 57 | suites.shift(); 58 | } 59 | } 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/interfaces/index.js: -------------------------------------------------------------------------------- 1 | exports.bdd = require('./bdd'); 2 | exports.tdd = require('./tdd'); 3 | exports.qunit = require('./qunit'); 4 | exports.exports = require('./exports'); 5 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/pending.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `Pending`. 4 | */ 5 | 6 | module.exports = Pending; 7 | 8 | /** 9 | * Initialize a new `Pending` error with the given message. 10 | * 11 | * @param {string} message 12 | */ 13 | function Pending(message) { 14 | this.message = message; 15 | } 16 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/doc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Base = require('./base'); 6 | var utils = require('../utils'); 7 | 8 | /** 9 | * Expose `Doc`. 10 | */ 11 | 12 | exports = module.exports = Doc; 13 | 14 | /** 15 | * Initialize a new `Doc` reporter. 16 | * 17 | * @param {Runner} runner 18 | * @api public 19 | */ 20 | function Doc(runner) { 21 | Base.call(this, runner); 22 | 23 | var indents = 2; 24 | 25 | function indent() { 26 | return Array(indents).join(' '); 27 | } 28 | 29 | runner.on('suite', function(suite) { 30 | if (suite.root) { 31 | return; 32 | } 33 | ++indents; 34 | console.log('%s
', indent()); 35 | ++indents; 36 | console.log('%s

%s

', indent(), utils.escape(suite.title)); 37 | console.log('%s
', indent()); 38 | }); 39 | 40 | runner.on('suite end', function(suite) { 41 | if (suite.root) { 42 | return; 43 | } 44 | console.log('%s
', indent()); 45 | --indents; 46 | console.log('%s
', indent()); 47 | --indents; 48 | }); 49 | 50 | runner.on('pass', function(test) { 51 | console.log('%s
%s
', indent(), utils.escape(test.title)); 52 | var code = utils.escape(utils.clean(test.fn.toString())); 53 | console.log('%s
%s
', indent(), code); 54 | }); 55 | 56 | runner.on('fail', function(test, err) { 57 | console.log('%s
%s
', indent(), utils.escape(test.title)); 58 | var code = utils.escape(utils.clean(test.fn.toString())); 59 | console.log('%s
%s
', indent(), code); 60 | console.log('%s
%s
', indent(), utils.escape(err)); 61 | }); 62 | } 63 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/dot.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Base = require('./base'); 6 | var inherits = require('../utils').inherits; 7 | var color = Base.color; 8 | 9 | /** 10 | * Expose `Dot`. 11 | */ 12 | 13 | exports = module.exports = Dot; 14 | 15 | /** 16 | * Initialize a new `Dot` matrix test reporter. 17 | * 18 | * @api public 19 | * @param {Runner} runner 20 | */ 21 | function Dot(runner) { 22 | Base.call(this, runner); 23 | 24 | var self = this; 25 | var width = Base.window.width * .75 | 0; 26 | var n = -1; 27 | 28 | runner.on('start', function() { 29 | process.stdout.write('\n'); 30 | }); 31 | 32 | runner.on('pending', function() { 33 | if (++n % width === 0) { 34 | process.stdout.write('\n '); 35 | } 36 | process.stdout.write(color('pending', Base.symbols.dot)); 37 | }); 38 | 39 | runner.on('pass', function(test) { 40 | if (++n % width === 0) { 41 | process.stdout.write('\n '); 42 | } 43 | if (test.speed === 'slow') { 44 | process.stdout.write(color('bright yellow', Base.symbols.dot)); 45 | } else { 46 | process.stdout.write(color(test.speed, Base.symbols.dot)); 47 | } 48 | }); 49 | 50 | runner.on('fail', function() { 51 | if (++n % width === 0) { 52 | process.stdout.write('\n '); 53 | } 54 | process.stdout.write(color('fail', Base.symbols.dot)); 55 | }); 56 | 57 | runner.on('end', function() { 58 | console.log(); 59 | self.epilogue(); 60 | }); 61 | } 62 | 63 | /** 64 | * Inherit from `Base.prototype`. 65 | */ 66 | inherits(Dot, Base); 67 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/html-cov.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var JSONCov = require('./json-cov'); 6 | var readFileSync = require('fs').readFileSync; 7 | var join = require('path').join; 8 | 9 | /** 10 | * Expose `HTMLCov`. 11 | */ 12 | 13 | exports = module.exports = HTMLCov; 14 | 15 | /** 16 | * Initialize a new `JsCoverage` reporter. 17 | * 18 | * @api public 19 | * @param {Runner} runner 20 | */ 21 | function HTMLCov(runner) { 22 | var jade = require('jade'); 23 | var file = join(__dirname, '/templates/coverage.jade'); 24 | var str = readFileSync(file, 'utf8'); 25 | var fn = jade.compile(str, { filename: file }); 26 | var self = this; 27 | 28 | JSONCov.call(this, runner, false); 29 | 30 | runner.on('end', function() { 31 | process.stdout.write(fn({ 32 | cov: self.cov, 33 | coverageClass: coverageClass 34 | })); 35 | }); 36 | } 37 | 38 | /** 39 | * Return coverage class for a given coverage percentage. 40 | * 41 | * @api private 42 | * @param {number} coveragePctg 43 | * @return {string} 44 | */ 45 | function coverageClass(coveragePctg) { 46 | if (coveragePctg >= 75) { 47 | return 'high'; 48 | } 49 | if (coveragePctg >= 50) { 50 | return 'medium'; 51 | } 52 | if (coveragePctg >= 25) { 53 | return 'low'; 54 | } 55 | return 'terrible'; 56 | } 57 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/index.js: -------------------------------------------------------------------------------- 1 | // Alias exports to a their normalized format Mocha#reporter to prevent a need 2 | // for dynamic (try/catch) requires, which Browserify doesn't handle. 3 | exports.Base = exports.base = require('./base'); 4 | exports.Dot = exports.dot = require('./dot'); 5 | exports.Doc = exports.doc = require('./doc'); 6 | exports.TAP = exports.tap = require('./tap'); 7 | exports.JSON = exports.json = require('./json'); 8 | exports.HTML = exports.html = require('./html'); 9 | exports.List = exports.list = require('./list'); 10 | exports.Min = exports.min = require('./min'); 11 | exports.Spec = exports.spec = require('./spec'); 12 | exports.Nyan = exports.nyan = require('./nyan'); 13 | exports.XUnit = exports.xunit = require('./xunit'); 14 | exports.Markdown = exports.markdown = require('./markdown'); 15 | exports.Progress = exports.progress = require('./progress'); 16 | exports.Landing = exports.landing = require('./landing'); 17 | exports.JSONCov = exports['json-cov'] = require('./json-cov'); 18 | exports.HTMLCov = exports['html-cov'] = require('./html-cov'); 19 | exports.JSONStream = exports['json-stream'] = require('./json-stream'); 20 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/json-stream.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Base = require('./base'); 6 | 7 | /** 8 | * Expose `List`. 9 | */ 10 | 11 | exports = module.exports = List; 12 | 13 | /** 14 | * Initialize a new `List` test reporter. 15 | * 16 | * @api public 17 | * @param {Runner} runner 18 | */ 19 | function List(runner) { 20 | Base.call(this, runner); 21 | 22 | var self = this; 23 | var total = runner.total; 24 | 25 | runner.on('start', function() { 26 | console.log(JSON.stringify(['start', { total: total }])); 27 | }); 28 | 29 | runner.on('pass', function(test) { 30 | console.log(JSON.stringify(['pass', clean(test)])); 31 | }); 32 | 33 | runner.on('fail', function(test, err) { 34 | test = clean(test); 35 | test.err = err.message; 36 | test.stack = err.stack || null; 37 | console.log(JSON.stringify(['fail', test])); 38 | }); 39 | 40 | runner.on('end', function() { 41 | process.stdout.write(JSON.stringify(['end', self.stats])); 42 | }); 43 | } 44 | 45 | /** 46 | * Return a plain-object representation of `test` 47 | * free of cyclic properties etc. 48 | * 49 | * @api private 50 | * @param {Object} test 51 | * @return {Object} 52 | */ 53 | function clean(test) { 54 | return { 55 | title: test.title, 56 | fullTitle: test.fullTitle(), 57 | duration: test.duration 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/list.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Base = require('./base'); 6 | var inherits = require('../utils').inherits; 7 | var color = Base.color; 8 | var cursor = Base.cursor; 9 | 10 | /** 11 | * Expose `List`. 12 | */ 13 | 14 | exports = module.exports = List; 15 | 16 | /** 17 | * Initialize a new `List` test reporter. 18 | * 19 | * @api public 20 | * @param {Runner} runner 21 | */ 22 | function List(runner) { 23 | Base.call(this, runner); 24 | 25 | var self = this; 26 | var n = 0; 27 | 28 | runner.on('start', function() { 29 | console.log(); 30 | }); 31 | 32 | runner.on('test', function(test) { 33 | process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); 34 | }); 35 | 36 | runner.on('pending', function(test) { 37 | var fmt = color('checkmark', ' -') 38 | + color('pending', ' %s'); 39 | console.log(fmt, test.fullTitle()); 40 | }); 41 | 42 | runner.on('pass', function(test) { 43 | var fmt = color('checkmark', ' ' + Base.symbols.dot) 44 | + color('pass', ' %s: ') 45 | + color(test.speed, '%dms'); 46 | cursor.CR(); 47 | console.log(fmt, test.fullTitle(), test.duration); 48 | }); 49 | 50 | runner.on('fail', function(test) { 51 | cursor.CR(); 52 | console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); 53 | }); 54 | 55 | runner.on('end', self.epilogue.bind(self)); 56 | } 57 | 58 | /** 59 | * Inherit from `Base.prototype`. 60 | */ 61 | inherits(List, Base); 62 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Base = require('./base'); 6 | var inherits = require('../utils').inherits; 7 | 8 | /** 9 | * Expose `Min`. 10 | */ 11 | 12 | exports = module.exports = Min; 13 | 14 | /** 15 | * Initialize a new `Min` minimal test reporter (best used with --watch). 16 | * 17 | * @api public 18 | * @param {Runner} runner 19 | */ 20 | function Min(runner) { 21 | Base.call(this, runner); 22 | 23 | runner.on('start', function() { 24 | // clear screen 25 | process.stdout.write('\u001b[2J'); 26 | // set cursor position 27 | process.stdout.write('\u001b[1;3H'); 28 | }); 29 | 30 | runner.on('end', this.epilogue.bind(this)); 31 | } 32 | 33 | /** 34 | * Inherit from `Base.prototype`. 35 | */ 36 | inherits(Min, Base); 37 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/tap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Base = require('./base'); 6 | 7 | /** 8 | * Expose `TAP`. 9 | */ 10 | 11 | exports = module.exports = TAP; 12 | 13 | /** 14 | * Initialize a new `TAP` reporter. 15 | * 16 | * @api public 17 | * @param {Runner} runner 18 | */ 19 | function TAP(runner) { 20 | Base.call(this, runner); 21 | 22 | var n = 1; 23 | var passes = 0; 24 | var failures = 0; 25 | 26 | runner.on('start', function() { 27 | var total = runner.grepTotal(runner.suite); 28 | console.log('%d..%d', 1, total); 29 | }); 30 | 31 | runner.on('test end', function() { 32 | ++n; 33 | }); 34 | 35 | runner.on('pending', function(test) { 36 | console.log('ok %d %s # SKIP -', n, title(test)); 37 | }); 38 | 39 | runner.on('pass', function(test) { 40 | passes++; 41 | console.log('ok %d %s', n, title(test)); 42 | }); 43 | 44 | runner.on('fail', function(test, err) { 45 | failures++; 46 | console.log('not ok %d %s', n, title(test)); 47 | if (err.stack) { 48 | console.log(err.stack.replace(/^/gm, ' ')); 49 | } 50 | }); 51 | 52 | runner.on('end', function() { 53 | console.log('# tests ' + (passes + failures)); 54 | console.log('# pass ' + passes); 55 | console.log('# fail ' + failures); 56 | }); 57 | } 58 | 59 | /** 60 | * Return a TAP-safe title of `test` 61 | * 62 | * @api private 63 | * @param {Object} test 64 | * @return {String} 65 | */ 66 | function title(test) { 67 | return test.fullTitle().replace(/#/g, ''); 68 | } 69 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/templates/coverage.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title Coverage 5 | meta(charset='utf-8') 6 | include script.html 7 | include style.html 8 | body 9 | #coverage 10 | h1#overview Coverage 11 | include menu 12 | 13 | #stats(class=coverageClass(cov.coverage)) 14 | .percentage #{cov.coverage | 0}% 15 | .sloc= cov.sloc 16 | .hits= cov.hits 17 | .misses= cov.misses 18 | 19 | #files 20 | for file in cov.files 21 | .file 22 | h2(id=file.filename)= file.filename 23 | #stats(class=coverageClass(file.coverage)) 24 | .percentage #{file.coverage | 0}% 25 | .sloc= file.sloc 26 | .hits= file.hits 27 | .misses= file.misses 28 | 29 | table#source 30 | thead 31 | tr 32 | th Line 33 | th Hits 34 | th Source 35 | tbody 36 | for line, number in file.source 37 | if line.coverage > 0 38 | tr.hit 39 | td.line= number 40 | td.hits= line.coverage 41 | td.source= line.source 42 | else if 0 === line.coverage 43 | tr.miss 44 | td.line= number 45 | td.hits 0 46 | td.source= line.source 47 | else 48 | tr 49 | td.line= number 50 | td.hits 51 | td.source= line.source || ' ' 52 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/templates/menu.jade: -------------------------------------------------------------------------------- 1 | #menu 2 | li 3 | a(href='#overview') overview 4 | for file in cov.files 5 | li 6 | span.cov(class=coverageClass(file.coverage)) #{file.coverage | 0} 7 | a(href='##{file.filename}') 8 | segments = file.filename.split('/') 9 | basename = segments.pop() 10 | if segments.length 11 | span.dirname= segments.join('/') + '/' 12 | span.basename= basename 13 | a#logo(href='http://mochajs.org/') m 14 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/reporters/templates/script.html: -------------------------------------------------------------------------------- 1 | 35 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /node_modules/mocha/lib/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Runnable = require('./runnable'); 6 | var inherits = require('./utils').inherits; 7 | 8 | /** 9 | * Expose `Test`. 10 | */ 11 | 12 | module.exports = Test; 13 | 14 | /** 15 | * Initialize a new `Test` with the given `title` and callback `fn`. 16 | * 17 | * @api private 18 | * @param {String} title 19 | * @param {Function} fn 20 | */ 21 | function Test(title, fn) { 22 | Runnable.call(this, title, fn); 23 | this.pending = !fn; 24 | this.type = 'test'; 25 | } 26 | 27 | /** 28 | * Inherit from `Runnable.prototype`. 29 | */ 30 | inherits(Test, Runnable); 31 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/.bin/jade: -------------------------------------------------------------------------------- 1 | ../jade/bin/jade -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/.bin/mkdirp: -------------------------------------------------------------------------------- 1 | ../mkdirp/bin/cmd.js -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/.bin/supports-color: -------------------------------------------------------------------------------- 1 | ../supports-color/cli.js -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 3 | THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) 4 | THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) 5 | 6 | # BIN directory 7 | BIN := $(THIS_DIR)/node_modules/.bin 8 | 9 | # applications 10 | NODE ?= $(shell which node) 11 | NPM ?= $(NODE) $(shell which npm) 12 | BROWSERIFY ?= $(NODE) $(BIN)/browserify 13 | 14 | all: dist/debug.js 15 | 16 | install: node_modules 17 | 18 | clean: 19 | @rm -rf dist 20 | 21 | dist: 22 | @mkdir -p $@ 23 | 24 | dist/debug.js: node_modules browser.js debug.js dist 25 | @$(BROWSERIFY) \ 26 | --standalone debug \ 27 | . > $@ 28 | 29 | distclean: clean 30 | @rm -rf node_modules 31 | 32 | node_modules: package.json 33 | @NODE_ENV= $(NPM) install 34 | @touch node_modules 35 | 36 | .PHONY: all install clean distclean 37 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.2.0", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.2.0", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/node_modules/ms/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.7.1 / 2015-04-20 3 | ================== 4 | 5 | * prevent extraordinary long inputs (@evilpacket) 6 | * Fixed broken readme link 7 | 8 | 0.7.0 / 2014-11-24 9 | ================== 10 | 11 | * add time abbreviations, updated tests and readme for the new units 12 | * fix example in the readme. 13 | * add LICENSE file 14 | 15 | 0.6.2 / 2013-12-05 16 | ================== 17 | 18 | * Adding repository section to package.json to suppress warning from NPM. 19 | 20 | 0.6.1 / 2013-05-10 21 | ================== 22 | 23 | * fix singularization [visionmedia] 24 | 25 | 0.6.0 / 2013-03-15 26 | ================== 27 | 28 | * fix minutes 29 | 30 | 0.5.1 / 2013-02-24 31 | ================== 32 | 33 | * add component namespace 34 | 35 | 0.5.0 / 2012-11-09 36 | ================== 37 | 38 | * add short formatting as default and .long option 39 | * add .license property to component.json 40 | * add version to component.json 41 | 42 | 0.4.0 / 2012-10-22 43 | ================== 44 | 45 | * add rounding to fix crazy decimals 46 | 47 | 0.3.0 / 2012-09-07 48 | ================== 49 | 50 | * fix `ms()` [visionmedia] 51 | 52 | 0.2.0 / 2012-09-03 53 | ================== 54 | 55 | * add component.json [visionmedia] 56 | * add days support [visionmedia] 57 | * add hours support [visionmedia] 58 | * add minutes support [visionmedia] 59 | * add seconds support [visionmedia] 60 | * add ms string support [visionmedia] 61 | * refactor tests to facilitate ms(number) [visionmedia] 62 | 63 | 0.1.0 / 2012-03-07 64 | ================== 65 | 66 | * Initial release 67 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/node_modules/ms/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/node_modules/ms/README.md: -------------------------------------------------------------------------------- 1 | # ms.js: miliseconds conversion utility 2 | 3 | ```js 4 | ms('2 days') // 172800000 5 | ms('1d') // 86400000 6 | ms('10h') // 36000000 7 | ms('2.5 hrs') // 9000000 8 | ms('2h') // 7200000 9 | ms('1m') // 60000 10 | ms('5s') // 5000 11 | ms('100') // 100 12 | ``` 13 | 14 | ```js 15 | ms(60000) // "1m" 16 | ms(2 * 60000) // "2m" 17 | ms(ms('10 hours')) // "10h" 18 | ``` 19 | 20 | ```js 21 | ms(60000, { long: true }) // "1 minute" 22 | ms(2 * 60000, { long: true }) // "2 minutes" 23 | ms(ms('10 hours'), { long: true }) // "10 hours" 24 | ``` 25 | 26 | - Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). 27 | - If a number is supplied to `ms`, a string with a unit is returned. 28 | - If a string that contains the number is supplied, it returns it as 29 | a number (e.g: it returns `100` for `'100'`). 30 | - If you pass a string with a number and a valid unit, the number of 31 | equivalent ms is returned. 32 | 33 | ## License 34 | 35 | MIT 36 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/debug/node_modules/ms/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ms", 3 | "version": "0.7.1", 4 | "description": "Tiny ms conversion utility", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/guille/ms.js.git" 8 | }, 9 | "main": "./index", 10 | "devDependencies": { 11 | "mocha": "*", 12 | "expect.js": "*", 13 | "serve": "*" 14 | }, 15 | "component": { 16 | "scripts": { 17 | "ms/index.js": "index.js" 18 | } 19 | }, 20 | "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", 21 | "bugs": { 22 | "url": "https://github.com/guille/ms.js/issues" 23 | }, 24 | "homepage": "https://github.com/guille/ms.js", 25 | "_id": "ms@0.7.1", 26 | "scripts": {}, 27 | "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", 28 | "_from": "ms@0.7.1", 29 | "_npmVersion": "2.7.5", 30 | "_nodeVersion": "0.12.2", 31 | "_npmUser": { 32 | "name": "rauchg", 33 | "email": "rauchg@gmail.com" 34 | }, 35 | "maintainers": [ 36 | { 37 | "name": "rauchg", 38 | "email": "rauchg@gmail.com" 39 | } 40 | ], 41 | "dist": { 42 | "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", 43 | "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" 44 | }, 45 | "directories": {}, 46 | "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" 47 | } 48 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/escape-string-regexp/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; 4 | 5 | module.exports = function (str) { 6 | if (typeof str !== 'string') { 7 | throw new TypeError('Expected a string'); 8 | } 9 | 10 | return str.replace(matchOperatorsRe, '\\$&'); 11 | }; 12 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/escape-string-regexp/readme.md: -------------------------------------------------------------------------------- 1 | # escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) 2 | 3 | > Escape RegExp special characters 4 | 5 | 6 | ## Install 7 | 8 | ```sh 9 | $ npm install --save escape-string-regexp 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var escapeStringRegexp = require('escape-string-regexp'); 17 | 18 | var escapedString = escapeStringRegexp('how much $ for a unicorn?'); 19 | //=> how much \$ for a unicorn\? 20 | 21 | new RegExp(escapedString); 22 | ``` 23 | 24 | 25 | ## License 26 | 27 | MIT © [Sindre Sorhus](http://sindresorhus.com) 28 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/.npmignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | test/a/ 3 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/examples/g.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "test/a/**/[cg]/../[cg]" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/examples/usr-local.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "{./*/*,/*,/usr/local/*}" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md: -------------------------------------------------------------------------------- 1 | # graceful-fs 2 | 3 | graceful-fs functions as a drop-in replacement for the fs module, 4 | making various improvements. 5 | 6 | The improvements are meant to normalize behavior across different 7 | platforms and environments, and to make filesystem access more 8 | resilient to errors. 9 | 10 | ## Improvements over fs module 11 | 12 | graceful-fs: 13 | 14 | * Queues up `open` and `readdir` calls, and retries them once 15 | something closes if there is an EMFILE error from too many file 16 | descriptors. 17 | * fixes `lchmod` for Node versions prior to 0.6.2. 18 | * implements `fs.lutimes` if possible. Otherwise it becomes a noop. 19 | * ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or 20 | `lchown` if the user isn't root. 21 | * makes `lchmod` and `lchown` become noops, if not available. 22 | * retries reading a file if `read` results in EAGAIN error. 23 | 24 | On Windows, it retries renaming a file for up to one second if `EACCESS` 25 | or `EPERM` error occurs, likely because antivirus software has locked 26 | the directory. 27 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var fs = require('../graceful-fs.js') 3 | 4 | test('graceful fs is monkeypatched fs', function (t) { 5 | t.equal(fs, require('fs')) 6 | t.end() 7 | }) 8 | 9 | test('open an existing file works', function (t) { 10 | var fd = fs.openSync(__filename, 'r') 11 | fs.closeSync(fd) 12 | fs.open(__filename, 'r', function (er, fd) { 13 | if (er) throw er 14 | fs.close(fd, function (er) { 15 | if (er) throw er 16 | t.pass('works') 17 | t.end() 18 | }) 19 | }) 20 | }) 21 | 22 | test('open a non-existing file throws', function (t) { 23 | var er 24 | try { 25 | var fd = fs.openSync('this file does not exist', 'r') 26 | } catch (x) { 27 | er = x 28 | } 29 | t.ok(er, 'should throw') 30 | t.notOk(fd, 'should not get an fd') 31 | t.equal(er.code, 'ENOENT') 32 | 33 | fs.open('neither does this file', 'r', function (er, fd) { 34 | t.ok(er, 'should throw') 35 | t.notOk(fd, 'should not get an fd') 36 | t.equal(er.code, 'ENOENT') 37 | t.end() 38 | }) 39 | }) 40 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/readdir-sort.js: -------------------------------------------------------------------------------- 1 | var test = require("tap").test 2 | var fs = require("fs") 3 | 4 | var readdir = fs.readdir 5 | fs.readdir = function(path, cb) { 6 | process.nextTick(function() { 7 | cb(null, ["b", "z", "a"]) 8 | }) 9 | } 10 | 11 | var g = require("../") 12 | 13 | test("readdir reorder", function (t) { 14 | g.readdir("whatevers", function (er, files) { 15 | if (er) 16 | throw er 17 | console.error(files) 18 | t.same(files, [ "a", "b", "z" ]) 19 | t.end() 20 | }) 21 | }) 22 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 4 | "version": "2.0.1", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented", 11 | "inherits", 12 | "browser", 13 | "browserify" 14 | ], 15 | "main": "./inherits.js", 16 | "browser": "./inherits_browser.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/inherits.git" 20 | }, 21 | "license": "ISC", 22 | "scripts": { 23 | "test": "node test" 24 | }, 25 | "bugs": { 26 | "url": "https://github.com/isaacs/inherits/issues" 27 | }, 28 | "_id": "inherits@2.0.1", 29 | "dist": { 30 | "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", 31 | "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" 32 | }, 33 | "_from": "inherits@2.0.1", 34 | "_npmVersion": "1.3.8", 35 | "_npmUser": { 36 | "name": "isaacs", 37 | "email": "i@izs.me" 38 | }, 39 | "maintainers": [ 40 | { 41 | "name": "isaacs", 42 | "email": "i@izs.me" 43 | } 44 | ], 45 | "directories": {}, 46 | "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", 47 | "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", 48 | "readme": "ERROR: No README data found!", 49 | "homepage": "https://github.com/isaacs/inherits#readme" 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.8' 4 | - '0.10' 5 | - '0.12' 6 | - 'iojs' 7 | before_install: 8 | - npm install -g npm@latest 9 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # Authors, sorted by whether or not they are me 2 | Isaac Z. Schlueter 3 | Brian Cottingham 4 | Carlos Brito Lage 5 | Jesse Dailey 6 | Kevin O'Hara 7 | Marco Rogers 8 | Mark Cavage 9 | Marko Mikulicic 10 | Nathan Rajlich 11 | Satheesh Natesan 12 | Trent Mick 13 | ashleybrener 14 | n4kz 15 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lru-cache", 3 | "description": "A cache object that deletes the least-recently-used items.", 4 | "version": "2.7.3", 5 | "author": { 6 | "name": "Isaac Z. Schlueter", 7 | "email": "i@izs.me" 8 | }, 9 | "keywords": [ 10 | "mru", 11 | "lru", 12 | "cache" 13 | ], 14 | "scripts": { 15 | "test": "tap test --gc" 16 | }, 17 | "main": "lib/lru-cache.js", 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/isaacs/node-lru-cache.git" 21 | }, 22 | "devDependencies": { 23 | "tap": "^1.2.0", 24 | "weak": "" 25 | }, 26 | "license": "ISC", 27 | "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714", 28 | "bugs": { 29 | "url": "https://github.com/isaacs/node-lru-cache/issues" 30 | }, 31 | "homepage": "https://github.com/isaacs/node-lru-cache#readme", 32 | "_id": "lru-cache@2.7.3", 33 | "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", 34 | "_from": "lru-cache@>=2.0.0 <3.0.0", 35 | "_npmVersion": "3.3.2", 36 | "_nodeVersion": "4.0.0", 37 | "_npmUser": { 38 | "name": "isaacs", 39 | "email": "i@izs.me" 40 | }, 41 | "dist": { 42 | "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", 43 | "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" 44 | }, 45 | "maintainers": [ 46 | { 47 | "name": "isaacs", 48 | "email": "isaacs@npmjs.com" 49 | }, 50 | { 51 | "name": "othiym23", 52 | "email": "ogd@aoaioxxysz.net" 53 | } 54 | ], 55 | "directories": {}, 56 | "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", 57 | "readme": "ERROR: No README data found!" 58 | } 59 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node --expose_gc 2 | 3 | 4 | var weak = require('weak'); 5 | var test = require('tap').test 6 | var LRU = require('../') 7 | var l = new LRU({ max: 10 }) 8 | var refs = 0 9 | function X() { 10 | refs ++ 11 | weak(this, deref) 12 | } 13 | 14 | function deref() { 15 | refs -- 16 | } 17 | 18 | test('no leaks', function (t) { 19 | // fill up the cache 20 | for (var i = 0; i < 100; i++) { 21 | l.set(i, new X); 22 | // throw some gets in there, too. 23 | if (i % 2 === 0) 24 | l.get(i / 2) 25 | } 26 | 27 | gc() 28 | 29 | var start = process.memoryUsage() 30 | 31 | // capture the memory 32 | var startRefs = refs 33 | 34 | // do it again, but more 35 | for (var i = 0; i < 10000; i++) { 36 | l.set(i, new X); 37 | // throw some gets in there, too. 38 | if (i % 2 === 0) 39 | l.get(i / 2) 40 | } 41 | 42 | gc() 43 | 44 | var end = process.memoryUsage() 45 | t.equal(refs, startRefs, 'no leaky refs') 46 | 47 | console.error('start: %j\n' + 48 | 'end: %j', start, end); 49 | t.pass(); 50 | t.end(); 51 | }) 52 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sigmund", 3 | "version": "1.0.1", 4 | "description": "Quick and dirty signatures for Objects.", 5 | "main": "sigmund.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "tap": "~0.3.0" 12 | }, 13 | "scripts": { 14 | "test": "tap test/*.js", 15 | "bench": "node bench.js" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/sigmund.git" 20 | }, 21 | "keywords": [ 22 | "object", 23 | "signature", 24 | "key", 25 | "data", 26 | "psychoanalysis" 27 | ], 28 | "author": { 29 | "name": "Isaac Z. Schlueter", 30 | "email": "i@izs.me", 31 | "url": "http://blog.izs.me/" 32 | }, 33 | "license": "ISC", 34 | "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6", 35 | "bugs": { 36 | "url": "https://github.com/isaacs/sigmund/issues" 37 | }, 38 | "homepage": "https://github.com/isaacs/sigmund#readme", 39 | "_id": "sigmund@1.0.1", 40 | "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", 41 | "_from": "sigmund@>=1.0.0 <1.1.0", 42 | "_npmVersion": "2.10.0", 43 | "_nodeVersion": "2.0.1", 44 | "_npmUser": { 45 | "name": "isaacs", 46 | "email": "isaacs@npmjs.com" 47 | }, 48 | "dist": { 49 | "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", 50 | "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" 51 | }, 52 | "maintainers": [ 53 | { 54 | "name": "isaacs", 55 | "email": "i@izs.me" 56 | } 57 | ], 58 | "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", 59 | "readme": "ERROR: No README data found!" 60 | } 61 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js: -------------------------------------------------------------------------------- 1 | module.exports = sigmund 2 | function sigmund (subject, maxSessions) { 3 | maxSessions = maxSessions || 10; 4 | var notes = []; 5 | var analysis = ''; 6 | var RE = RegExp; 7 | 8 | function psychoAnalyze (subject, session) { 9 | if (session > maxSessions) return; 10 | 11 | if (typeof subject === 'function' || 12 | typeof subject === 'undefined') { 13 | return; 14 | } 15 | 16 | if (typeof subject !== 'object' || !subject || 17 | (subject instanceof RE)) { 18 | analysis += subject; 19 | return; 20 | } 21 | 22 | if (notes.indexOf(subject) !== -1 || session === maxSessions) return; 23 | 24 | notes.push(subject); 25 | analysis += '{'; 26 | Object.keys(subject).forEach(function (issue, _, __) { 27 | // pseudo-private values. skip those. 28 | if (issue.charAt(0) === '_') return; 29 | var to = typeof subject[issue]; 30 | if (to === 'function' || to === 'undefined') return; 31 | analysis += issue; 32 | psychoAnalyze(subject[issue], session + 1); 33 | }); 34 | } 35 | psychoAnalyze(subject, 0); 36 | return analysis; 37 | } 38 | 39 | // vim: set softtabstop=4 shiftwidth=4: 40 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var sigmund = require('../sigmund.js') 3 | 4 | 5 | // occasionally there are duplicates 6 | // that's an acceptable edge-case. JSON.stringify and util.inspect 7 | // have some collision potential as well, though less, and collision 8 | // detection is expensive. 9 | var hash = '{abc/def/g{0h1i2{jkl' 10 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 11 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 12 | 13 | var obj3 = JSON.parse(JSON.stringify(obj1)) 14 | obj3.c = /def/ 15 | obj3.g[2].cycle = obj3 16 | var cycleHash = '{abc/def/g{0h1i2{jklcycle' 17 | 18 | test('basic', function (t) { 19 | t.equal(sigmund(obj1), hash) 20 | t.equal(sigmund(obj2), hash) 21 | t.equal(sigmund(obj3), cycleHash) 22 | t.end() 23 | }) 24 | 25 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Isaac Z. Schlueter", 4 | "email": "i@izs.me", 5 | "url": "http://blog.izs.me" 6 | }, 7 | "name": "minimatch", 8 | "description": "a glob matcher in javascript", 9 | "version": "0.2.14", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/isaacs/minimatch.git" 13 | }, 14 | "main": "minimatch.js", 15 | "scripts": { 16 | "test": "tap test/*.js" 17 | }, 18 | "engines": { 19 | "node": "*" 20 | }, 21 | "dependencies": { 22 | "lru-cache": "2", 23 | "sigmund": "~1.0.0" 24 | }, 25 | "devDependencies": { 26 | "tap": "" 27 | }, 28 | "license": { 29 | "type": "MIT", 30 | "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" 31 | }, 32 | "bugs": { 33 | "url": "https://github.com/isaacs/minimatch/issues" 34 | }, 35 | "homepage": "https://github.com/isaacs/minimatch", 36 | "_id": "minimatch@0.2.14", 37 | "dist": { 38 | "shasum": "c74e780574f63c6f9a090e90efbe6ef53a6a756a", 39 | "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" 40 | }, 41 | "_from": "minimatch@>=0.2.11 <0.3.0", 42 | "_npmVersion": "1.3.17", 43 | "_npmUser": { 44 | "name": "isaacs", 45 | "email": "i@izs.me" 46 | }, 47 | "maintainers": [ 48 | { 49 | "name": "isaacs", 50 | "email": "i@izs.me" 51 | } 52 | ], 53 | "directories": {}, 54 | "_shasum": "c74e780574f63c6f9a090e90efbe6ef53a6a756a", 55 | "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", 56 | "readme": "ERROR: No README data found!" 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | , minimatch = require("../") 3 | 4 | tap.test("brace expansion", function (t) { 5 | // [ pattern, [expanded] ] 6 | ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" 7 | , [ "abxy" 8 | , "abxz" 9 | , "acdxy" 10 | , "acdxz" 11 | , "acexy" 12 | , "acexz" 13 | , "afhxy" 14 | , "afhxz" 15 | , "aghxy" 16 | , "aghxz" ] ] 17 | , [ "a{1..5}b" 18 | , [ "a1b" 19 | , "a2b" 20 | , "a3b" 21 | , "a4b" 22 | , "a5b" ] ] 23 | , [ "a{b}c", ["a{b}c"] ] 24 | ].forEach(function (tc) { 25 | var p = tc[0] 26 | , expect = tc[1] 27 | t.equivalent(minimatch.braceExpand(p), expect, p) 28 | }) 29 | console.error("ending") 30 | t.end() 31 | }) 32 | 33 | 34 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js: -------------------------------------------------------------------------------- 1 | var Minimatch = require("../minimatch.js").Minimatch 2 | var tap = require("tap") 3 | tap.test("cache test", function (t) { 4 | var mm1 = new Minimatch("a?b") 5 | var mm2 = new Minimatch("a?b") 6 | t.equal(mm1, mm2, "should get the same object") 7 | // the lru should drop it after 100 entries 8 | for (var i = 0; i < 100; i ++) { 9 | new Minimatch("a"+i) 10 | } 11 | mm2 = new Minimatch("a?b") 12 | t.notEqual(mm1, mm2, "cache should have dropped") 13 | t.end() 14 | }) 15 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var minimatch = require('../') 3 | 4 | test('extglob ending with statechar', function(t) { 5 | t.notOk(minimatch('ax', 'a?(b*)')) 6 | t.ok(minimatch('ax', '?(a*|b)')) 7 | t.end() 8 | }) 9 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Isaac Z. Schlueter", 4 | "email": "i@izs.me", 5 | "url": "http://blog.izs.me/" 6 | }, 7 | "name": "glob", 8 | "description": "a little globber", 9 | "version": "3.2.3", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/isaacs/node-glob.git" 13 | }, 14 | "main": "glob.js", 15 | "engines": { 16 | "node": "*" 17 | }, 18 | "dependencies": { 19 | "minimatch": "~0.2.11", 20 | "graceful-fs": "~2.0.0", 21 | "inherits": "2" 22 | }, 23 | "devDependencies": { 24 | "tap": "~0.4.0", 25 | "mkdirp": "0", 26 | "rimraf": "1" 27 | }, 28 | "scripts": { 29 | "test": "tap test/*.js" 30 | }, 31 | "license": "BSD", 32 | "bugs": { 33 | "url": "https://github.com/isaacs/node-glob/issues" 34 | }, 35 | "_id": "glob@3.2.3", 36 | "dist": { 37 | "shasum": "e313eeb249c7affaa5c475286b0e115b59839467", 38 | "tarball": "http://registry.npmjs.org/glob/-/glob-3.2.3.tgz" 39 | }, 40 | "_from": "glob@3.2.3", 41 | "_npmVersion": "1.3.2", 42 | "_npmUser": { 43 | "name": "isaacs", 44 | "email": "i@izs.me" 45 | }, 46 | "maintainers": [ 47 | { 48 | "name": "isaacs", 49 | "email": "i@izs.me" 50 | } 51 | ], 52 | "directories": {}, 53 | "_shasum": "e313eeb249c7affaa5c475286b0e115b59839467", 54 | "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", 55 | "readme": "ERROR: No README data found!", 56 | "homepage": "https://github.com/isaacs/node-glob#readme" 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/test/cwd-test.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing cwd and searching for **/d", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('**/d', function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ 'b/c/d', 'c/d' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('a/b', function (t) { 26 | glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ 'c/d' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('a/b/', function (t) { 34 | glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ 'c/d' ]) 37 | t.end() 38 | }) 39 | }) 40 | 41 | t.test('.', function (t) { 42 | glob('**/d', {cwd: process.cwd()}, function (er, matches) { 43 | t.ifError(er) 44 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 45 | t.end() 46 | }) 47 | }) 48 | 49 | t.test('cd -', function (t) { 50 | process.chdir(origCwd) 51 | t.end() 52 | }) 53 | 54 | t.end() 55 | }) 56 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/test/globstar-match.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../glob.js").Glob 2 | var test = require('tap').test 3 | 4 | test('globstar should not have dupe matches', function(t) { 5 | var pattern = 'a/**/[gh]' 6 | var g = new Glob(pattern, { cwd: __dirname }) 7 | var matches = [] 8 | g.on('match', function(m) { 9 | console.error('match %j', m) 10 | matches.push(m) 11 | }) 12 | g.on('end', function(set) { 13 | console.error('set', set) 14 | matches = matches.sort() 15 | set = set.sort() 16 | t.same(matches, set, 'should have same set of matches') 17 | t.end() 18 | }) 19 | }) 20 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/test/root-nomount.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing root and searching for /b*/**", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('root=a, cwd=a/b', function (t) { 26 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('cd -', function (t) { 34 | process.chdir(origCwd) 35 | t.end() 36 | }) 37 | 38 | t.end() 39 | }) 40 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/test/root.js: -------------------------------------------------------------------------------- 1 | var t = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | var glob = require('../') 7 | var path = require('path') 8 | 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | 18 | t.test('a', function (t) { 19 | console.error("root=" + path.resolve('a')) 20 | glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { 21 | t.ifError(er) 22 | var wanted = [ 23 | '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' 24 | ].map(function (m) { 25 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 26 | }) 27 | 28 | t.like(matches, wanted) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('root=a, cwd=a/b', function (t) { 34 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { 37 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 38 | })) 39 | t.end() 40 | }) 41 | }) 42 | 43 | t.test('cd -', function (t) { 44 | process.chdir(origCwd) 45 | t.end() 46 | }) 47 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/test/stat.js: -------------------------------------------------------------------------------- 1 | var glob = require('../') 2 | var test = require('tap').test 3 | var path = require('path') 4 | 5 | test('stat all the things', function(t) { 6 | var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) 7 | var matches = [] 8 | g.on('match', function(m) { 9 | matches.push(m) 10 | }) 11 | var stats = [] 12 | g.on('stat', function(m) { 13 | stats.push(m) 14 | }) 15 | g.on('end', function(eof) { 16 | stats = stats.sort() 17 | matches = matches.sort() 18 | eof = eof.sort() 19 | t.same(stats, matches) 20 | t.same(eof, matches) 21 | var cache = Object.keys(this.statCache) 22 | t.same(cache.map(function (f) { 23 | return path.relative(__dirname, f) 24 | }).sort(), matches) 25 | 26 | cache.forEach(function(c) { 27 | t.equal(typeof this.statCache[c], 'object') 28 | }, this) 29 | 30 | t.end() 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/glob/test/zz-cleanup.js: -------------------------------------------------------------------------------- 1 | // remove the fixtures 2 | var tap = require("tap") 3 | , rimraf = require("rimraf") 4 | , path = require("path") 5 | 6 | tap.test("cleanup fixtures", function (t) { 7 | rimraf(path.resolve(__dirname, "a"), function (er) { 8 | t.ifError(er, "removed") 9 | t.end() 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/growl/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.7.0 / 2012-12-30 3 | ================== 4 | 5 | * support transient notifications in Gnome 6 | 7 | 1.6.1 / 2012-09-25 8 | ================== 9 | 10 | * restore compatibility with node < 0.8 [fgnass] 11 | 12 | 1.6.0 / 2012-09-06 13 | ================== 14 | 15 | * add notification center support [drudge] 16 | 17 | 1.5.1 / 2012-04-08 18 | ================== 19 | 20 | * Merge pull request #16 from KyleAMathews/patch-1 21 | * Fixes #15 22 | 23 | 1.5.0 / 2012-02-08 24 | ================== 25 | 26 | * Added windows support [perfusorius] 27 | 28 | 1.4.1 / 2011-12-28 29 | ================== 30 | 31 | * Fixed: dont exit(). Closes #9 32 | 33 | 1.4.0 / 2011-12-17 34 | ================== 35 | 36 | * Changed API: `growl.notify()` -> `growl()` 37 | 38 | 1.3.0 / 2011-12-17 39 | ================== 40 | 41 | * Added support for Ubuntu/Debian/Linux users [niftylettuce] 42 | * Fixed: send notifications even if title not specified [alessioalex] 43 | 44 | 1.2.0 / 2011-10-06 45 | ================== 46 | 47 | * Add support for priority. 48 | 49 | 1.1.0 / 2011-03-15 50 | ================== 51 | 52 | * Added optional callbacks 53 | * Added parsing of version 54 | 55 | 1.0.1 / 2010-03-26 56 | ================== 57 | 58 | * Fixed; sys.exec -> child_process.exec to support latest node 59 | 60 | 1.0.0 / 2010-03-19 61 | ================== 62 | 63 | * Initial release 64 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/growl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "growl", 3 | "version": "1.8.1", 4 | "description": "Growl unobtrusive notifications", 5 | "author": { 6 | "name": "TJ Holowaychuk", 7 | "email": "tj@vision-media.ca" 8 | }, 9 | "maintainers": [ 10 | { 11 | "name": "tjholowaychuk", 12 | "email": "tj@vision-media.ca" 13 | }, 14 | { 15 | "name": "jbnicolai", 16 | "email": "jappelman@xebia.com" 17 | } 18 | ], 19 | "repository": { 20 | "type": "git", 21 | "url": "git://github.com/visionmedia/node-growl.git" 22 | }, 23 | "main": "./lib/growl.js", 24 | "gitHead": "882ced3155a57f566887c884d5c6dccb7df435c1", 25 | "bugs": { 26 | "url": "https://github.com/visionmedia/node-growl/issues" 27 | }, 28 | "homepage": "https://github.com/visionmedia/node-growl", 29 | "_id": "growl@1.8.1", 30 | "scripts": {}, 31 | "_shasum": "4b2dec8d907e93db336624dcec0183502f8c9428", 32 | "_from": "growl@1.8.1", 33 | "_npmVersion": "1.4.20", 34 | "_npmUser": { 35 | "name": "jbnicolai", 36 | "email": "jappelman@xebia.com" 37 | }, 38 | "dist": { 39 | "shasum": "4b2dec8d907e93db336624dcec0183502f8c9428", 40 | "tarball": "http://registry.npmjs.org/growl/-/growl-1.8.1.tgz" 41 | }, 42 | "directories": {}, 43 | "_resolved": "https://registry.npmjs.org/growl/-/growl-1.8.1.tgz", 44 | "readme": "ERROR: No README data found!" 45 | } 46 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/growl/test.js: -------------------------------------------------------------------------------- 1 | 2 | var growl = require('./lib/growl') 3 | 4 | growl('You have mail!') 5 | growl('5 new messages', { sticky: true }) 6 | growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true }) 7 | growl('Message with title', { title: 'Title'}) 8 | growl('Set priority', { priority: 2 }) 9 | growl('Show Safari icon', { image: 'Safari' }) 10 | growl('Show icon', { image: 'path/to/icon.icns' }) 11 | growl('Show image', { image: 'path/to/my.image.png' }) 12 | growl('Show png filesystem icon', { image: 'png' }) 13 | growl('Show pdf filesystem icon', { image: 'article.pdf' }) 14 | growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(){ 15 | console.log('callback'); 16 | }) 17 | growl('Show pdf filesystem icon', { title: 'Use show()', image: 'article.pdf' }) 18 | growl('here \' are \n some \\ characters that " need escaping', {}, function(error, stdout, stderr) { 19 | if (error !== null) throw new Error('escaping failed:\n' + stdout + stderr); 20 | }) 21 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | support 3 | benchmarks 4 | examples 5 | lib-cov 6 | coverage.html 7 | .gitmodules 8 | .travis.yml 9 | History.md 10 | Readme.md 11 | Makefile 12 | test/ 13 | support/ 14 | benchmarks/ 15 | examples/ 16 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2009-2010 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = process.env.JADE_COV 3 | ? require('./lib-cov/jade') 4 | : require('./lib/jade'); -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/doctypes.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - doctypes 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | module.exports = { 9 | '5': '' 10 | , 'default': '' 11 | , 'xml': '' 12 | , 'transitional': '' 13 | , 'strict': '' 14 | , 'frameset': '' 15 | , '1.1': '' 16 | , 'basic': '' 17 | , 'mobile': '' 18 | }; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/inline-tags.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - inline tags 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | module.exports = [ 9 | 'a' 10 | , 'abbr' 11 | , 'acronym' 12 | , 'b' 13 | , 'br' 14 | , 'code' 15 | , 'em' 16 | , 'font' 17 | , 'i' 18 | , 'img' 19 | , 'ins' 20 | , 'kbd' 21 | , 'map' 22 | , 'samp' 23 | , 'small' 24 | , 'span' 25 | , 'strong' 26 | , 'sub' 27 | , 'sup' 28 | ]; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - BlockComment 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `BlockComment` with the given `block`. 16 | * 17 | * @param {String} val 18 | * @param {Block} block 19 | * @param {Boolean} buffer 20 | * @api public 21 | */ 22 | 23 | var BlockComment = module.exports = function BlockComment(val, block, buffer) { 24 | this.block = block; 25 | this.val = val; 26 | this.buffer = buffer; 27 | }; 28 | 29 | /** 30 | * Inherit from `Node`. 31 | */ 32 | 33 | BlockComment.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/case.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Case 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a new `Case` with `expr`. 16 | * 17 | * @param {String} expr 18 | * @api public 19 | */ 20 | 21 | var Case = exports = module.exports = function Case(expr, block){ 22 | this.expr = expr; 23 | this.block = block; 24 | }; 25 | 26 | /** 27 | * Inherit from `Node`. 28 | */ 29 | 30 | Case.prototype.__proto__ = Node.prototype; 31 | 32 | var When = exports.When = function When(expr, block){ 33 | this.expr = expr; 34 | this.block = block; 35 | this.debug = false; 36 | }; 37 | 38 | /** 39 | * Inherit from `Node`. 40 | */ 41 | 42 | When.prototype.__proto__ = Node.prototype; 43 | 44 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/code.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Code 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Code` node with the given code `val`. 16 | * Code may also be optionally buffered and escaped. 17 | * 18 | * @param {String} val 19 | * @param {Boolean} buffer 20 | * @param {Boolean} escape 21 | * @api public 22 | */ 23 | 24 | var Code = module.exports = function Code(val, buffer, escape) { 25 | this.val = val; 26 | this.buffer = buffer; 27 | this.escape = escape; 28 | if (val.match(/^ *else/)) this.debug = false; 29 | }; 30 | 31 | /** 32 | * Inherit from `Node`. 33 | */ 34 | 35 | Code.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/comment.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Comment 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Comment` with the given `val`, optionally `buffer`, 16 | * otherwise the comment may render in the output. 17 | * 18 | * @param {String} val 19 | * @param {Boolean} buffer 20 | * @api public 21 | */ 22 | 23 | var Comment = module.exports = function Comment(val, buffer) { 24 | this.val = val; 25 | this.buffer = buffer; 26 | }; 27 | 28 | /** 29 | * Inherit from `Node`. 30 | */ 31 | 32 | Comment.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/doctype.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Doctype 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Doctype` with the given `val`. 16 | * 17 | * @param {String} val 18 | * @api public 19 | */ 20 | 21 | var Doctype = module.exports = function Doctype(val) { 22 | this.val = val; 23 | }; 24 | 25 | /** 26 | * Inherit from `Node`. 27 | */ 28 | 29 | Doctype.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/each.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Each 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize an `Each` node, representing iteration 16 | * 17 | * @param {String} obj 18 | * @param {String} val 19 | * @param {String} key 20 | * @param {Block} block 21 | * @api public 22 | */ 23 | 24 | var Each = module.exports = function Each(obj, val, key, block) { 25 | this.obj = obj; 26 | this.val = val; 27 | this.key = key; 28 | this.block = block; 29 | }; 30 | 31 | /** 32 | * Inherit from `Node`. 33 | */ 34 | 35 | Each.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/filter.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Filter 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node') 13 | , Block = require('./block'); 14 | 15 | /** 16 | * Initialize a `Filter` node with the given 17 | * filter `name` and `block`. 18 | * 19 | * @param {String} name 20 | * @param {Block|Node} block 21 | * @api public 22 | */ 23 | 24 | var Filter = module.exports = function Filter(name, block, attrs) { 25 | this.name = name; 26 | this.block = block; 27 | this.attrs = attrs; 28 | this.isASTFilter = !block.nodes.every(function(node){ return node.isText }); 29 | }; 30 | 31 | /** 32 | * Inherit from `Node`. 33 | */ 34 | 35 | Filter.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | exports.Node = require('./node'); 9 | exports.Tag = require('./tag'); 10 | exports.Code = require('./code'); 11 | exports.Each = require('./each'); 12 | exports.Case = require('./case'); 13 | exports.Text = require('./text'); 14 | exports.Block = require('./block'); 15 | exports.Mixin = require('./mixin'); 16 | exports.Filter = require('./filter'); 17 | exports.Comment = require('./comment'); 18 | exports.Literal = require('./literal'); 19 | exports.BlockComment = require('./block-comment'); 20 | exports.Doctype = require('./doctype'); 21 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/literal.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Literal 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Literal` node with the given `str. 16 | * 17 | * @param {String} str 18 | * @api public 19 | */ 20 | 21 | var Literal = module.exports = function Literal(str) { 22 | this.str = str 23 | .replace(/\\/g, "\\\\") 24 | .replace(/\n|\r\n/g, "\\n") 25 | .replace(/'/g, "\\'"); 26 | }; 27 | 28 | /** 29 | * Inherit from `Node`. 30 | */ 31 | 32 | Literal.prototype.__proto__ = Node.prototype; 33 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/mixin.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Mixin 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Attrs = require('./attrs'); 13 | 14 | /** 15 | * Initialize a new `Mixin` with `name` and `block`. 16 | * 17 | * @param {String} name 18 | * @param {String} args 19 | * @param {Block} block 20 | * @api public 21 | */ 22 | 23 | var Mixin = module.exports = function Mixin(name, args, block, call){ 24 | this.name = name; 25 | this.args = args; 26 | this.block = block; 27 | this.attrs = []; 28 | this.call = call; 29 | }; 30 | 31 | /** 32 | * Inherit from `Attrs`. 33 | */ 34 | 35 | Mixin.prototype.__proto__ = Attrs.prototype; 36 | 37 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/node.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Node 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Initialize a `Node`. 10 | * 11 | * @api public 12 | */ 13 | 14 | var Node = module.exports = function Node(){}; 15 | 16 | /** 17 | * Clone this node (return itself) 18 | * 19 | * @return {Node} 20 | * @api private 21 | */ 22 | 23 | Node.prototype.clone = function(){ 24 | return this; 25 | }; 26 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/nodes/text.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Text 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Text` node with optional `line`. 16 | * 17 | * @param {String} line 18 | * @api public 19 | */ 20 | 21 | var Text = module.exports = function Text(line) { 22 | this.val = ''; 23 | if ('string' == typeof line) this.val = line; 24 | }; 25 | 26 | /** 27 | * Inherit from `Node`. 28 | */ 29 | 30 | Text.prototype.__proto__ = Node.prototype; 31 | 32 | /** 33 | * Flag as text. 34 | */ 35 | 36 | Text.prototype.isText = true; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/self-closing.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - self closing tags 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | module.exports = [ 9 | 'meta' 10 | , 'img' 11 | , 'link' 12 | , 'input' 13 | , 'source' 14 | , 'area' 15 | , 'base' 16 | , 'col' 17 | , 'br' 18 | , 'hr' 19 | ]; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/lib/utils.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - utils 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Convert interpolation in the given string to JavaScript. 10 | * 11 | * @param {String} str 12 | * @return {String} 13 | * @api private 14 | */ 15 | 16 | var interpolate = exports.interpolate = function(str){ 17 | return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ 18 | return escape 19 | ? str 20 | : "' + " 21 | + ('!' == flag ? '' : 'escape') 22 | + "((interp = " + code.replace(/\\'/g, "'") 23 | + ") == null ? '' : interp) + '"; 24 | }); 25 | }; 26 | 27 | /** 28 | * Escape single quotes in `str`. 29 | * 30 | * @param {String} str 31 | * @return {String} 32 | * @api private 33 | */ 34 | 35 | var escape = exports.escape = function(str) { 36 | return str.replace(/'/g, "\\'"); 37 | }; 38 | 39 | /** 40 | * Interpolate, and escape the given `str`. 41 | * 42 | * @param {String} str 43 | * @return {String} 44 | * @api private 45 | */ 46 | 47 | exports.text = function(str){ 48 | return interpolate(escape(str)); 49 | }; -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/commander/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/commander/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/commander/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TESTS = $(shell find test/test.*.js) 3 | 4 | test: 5 | @./test/run $(TESTS) 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/commander/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/commander'); -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/commander/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "commander", 3 | "version": "0.6.1", 4 | "description": "the complete solution for node.js command-line programs", 5 | "keywords": [ 6 | "command", 7 | "option", 8 | "parser", 9 | "prompt", 10 | "stdin" 11 | ], 12 | "author": { 13 | "name": "TJ Holowaychuk", 14 | "email": "tj@vision-media.ca" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/visionmedia/commander.js.git" 19 | }, 20 | "dependencies": {}, 21 | "devDependencies": { 22 | "should": ">= 0.0.1" 23 | }, 24 | "scripts": { 25 | "test": "make test" 26 | }, 27 | "main": "index", 28 | "engines": { 29 | "node": ">= 0.4.x" 30 | }, 31 | "_npmUser": { 32 | "name": "tjholowaychuk", 33 | "email": "tj@vision-media.ca" 34 | }, 35 | "_id": "commander@0.6.1", 36 | "optionalDependencies": {}, 37 | "_engineSupported": true, 38 | "_npmVersion": "1.1.0-3", 39 | "_nodeVersion": "v0.6.12", 40 | "_defaultsLoaded": true, 41 | "dist": { 42 | "shasum": "fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06", 43 | "tarball": "http://registry.npmjs.org/commander/-/commander-0.6.1.tgz" 44 | }, 45 | "maintainers": [ 46 | { 47 | "name": "tjholowaychuk", 48 | "email": "tj@vision-media.ca" 49 | } 50 | ], 51 | "directories": {}, 52 | "_shasum": "fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06", 53 | "_resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", 54 | "_from": "commander@0.6.1", 55 | "bugs": { 56 | "url": "https://github.com/visionmedia/commander.js/issues" 57 | }, 58 | "readme": "ERROR: No README data found!", 59 | "homepage": "https://github.com/visionmedia/commander.js#readme" 60 | } 61 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ .gitignore 3 | @@ -0,0 +1,2 @@ 4 | +node_modules/ 5 | +npm-debug.log -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 James Halliday (mail@substack.net) 2 | 3 | This project is free software released under the MIT/X11 license: 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown: -------------------------------------------------------------------------------- 1 | mkdirp 2 | ====== 3 | 4 | Like `mkdir -p`, but in node.js! 5 | 6 | example 7 | ======= 8 | 9 | pow.js 10 | ------ 11 | var mkdirp = require('mkdirp'); 12 | 13 | mkdirp('/tmp/foo/bar/baz', function (err) { 14 | if (err) console.error(err) 15 | else console.log('pow!') 16 | }); 17 | 18 | Output 19 | pow! 20 | 21 | And now /tmp/foo/bar/baz exists, huzzah! 22 | 23 | methods 24 | ======= 25 | 26 | var mkdirp = require('mkdirp'); 27 | 28 | mkdirp(dir, mode, cb) 29 | --------------------- 30 | 31 | Create a new directory and any necessary subdirectories at `dir` with octal 32 | permission string `mode`. 33 | 34 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. 35 | 36 | mkdirp.sync(dir, mode) 37 | ---------------------- 38 | 39 | Synchronously create a new directory and any necessary subdirectories at `dir` 40 | with octal permission string `mode`. 41 | 42 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. 43 | 44 | install 45 | ======= 46 | 47 | With [npm](http://npmjs.org) do: 48 | 49 | npm install mkdirp 50 | 51 | license 52 | ======= 53 | 54 | MIT/X11 55 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej: -------------------------------------------------------------------------------- 1 | --- examples/pow.js 2 | +++ examples/pow.js 3 | @@ -1,6 +1,15 @@ 4 | -var mkdirp = require('mkdirp').mkdirp; 5 | +var mkdirp = require('../').mkdirp, 6 | + mkdirpSync = require('../').mkdirpSync; 7 | 8 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 9 | if (err) console.error(err) 10 | else console.log('pow!') 11 | }); 12 | + 13 | +try { 14 | + mkdirpSync('/tmp/bar/foo/baz', 0755); 15 | + console.log('double pow!'); 16 | +} 17 | +catch (ex) { 18 | + console.log(ex); 19 | +} -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mkdirp", 3 | "description": "Recursively mkdir, like `mkdir -p`", 4 | "version": "0.3.0", 5 | "author": { 6 | "name": "James Halliday", 7 | "email": "mail@substack.net", 8 | "url": "http://substack.net" 9 | }, 10 | "main": "./index", 11 | "keywords": [ 12 | "mkdir", 13 | "directory" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com/substack/node-mkdirp.git" 18 | }, 19 | "scripts": { 20 | "test": "tap test/*.js" 21 | }, 22 | "devDependencies": { 23 | "tap": "0.0.x" 24 | }, 25 | "license": "MIT/X11", 26 | "engines": { 27 | "node": "*" 28 | }, 29 | "_npmUser": { 30 | "name": "substack", 31 | "email": "mail@substack.net" 32 | }, 33 | "_id": "mkdirp@0.3.0", 34 | "dependencies": {}, 35 | "_engineSupported": true, 36 | "_npmVersion": "1.0.106", 37 | "_nodeVersion": "v0.4.12", 38 | "_defaultsLoaded": true, 39 | "dist": { 40 | "shasum": "1bbf5ab1ba827af23575143490426455f481fe1e", 41 | "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz" 42 | }, 43 | "maintainers": [ 44 | { 45 | "name": "substack", 46 | "email": "mail@substack.net" 47 | } 48 | ], 49 | "directories": {}, 50 | "_shasum": "1bbf5ab1ba827af23575143490426455f481fe1e", 51 | "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", 52 | "_from": "mkdirp@0.3.0", 53 | "bugs": { 54 | "url": "https://github.com/substack/node-mkdirp/issues" 55 | }, 56 | "readme": "ERROR: No README data found!", 57 | "homepage": "https://github.com/substack/node-mkdirp#readme" 58 | } 59 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | var ps = [ '', 'tmp' ]; 7 | 8 | for (var i = 0; i < 25; i++) { 9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | ps.push(dir); 11 | } 12 | 13 | var file = ps.join('/'); 14 | 15 | test('chmod-pre', function (t) { 16 | var mode = 0744 17 | mkdirp(file, mode, function (er) { 18 | t.ifError(er, 'should not error'); 19 | fs.stat(file, function (er, stat) { 20 | t.ifError(er, 'should exist'); 21 | t.ok(stat && stat.isDirectory(), 'should be directory'); 22 | t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); 23 | t.end(); 24 | }); 25 | }); 26 | }); 27 | 28 | test('chmod', function (t) { 29 | var mode = 0755 30 | mkdirp(file, mode, function (er) { 31 | t.ifError(er, 'should not error'); 32 | fs.stat(file, function (er, stat) { 33 | t.ifError(er, 'should exist'); 34 | t.ok(stat && stat.isDirectory(), 'should be directory'); 35 | t.end(); 36 | }); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | var ps = [ '', 'tmp' ]; 7 | 8 | for (var i = 0; i < 25; i++) { 9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | ps.push(dir); 11 | } 12 | 13 | var file = ps.join('/'); 14 | 15 | // a file in the way 16 | var itw = ps.slice(0, 3).join('/'); 17 | 18 | 19 | test('clobber-pre', function (t) { 20 | console.error("about to write to "+itw) 21 | fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); 22 | 23 | fs.stat(itw, function (er, stat) { 24 | t.ifError(er) 25 | t.ok(stat && stat.isFile(), 'should be file') 26 | t.end() 27 | }) 28 | }) 29 | 30 | test('clobber', function (t) { 31 | t.plan(2); 32 | mkdirp(file, 0755, function (err) { 33 | t.ok(err); 34 | t.equal(err.code, 'ENOTDIR'); 35 | t.end(); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('woo', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | mkdirp(file, 0755, function (err) { 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, 0755); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('async perm', function (t) { 7 | t.plan(2); 8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); 9 | 10 | mkdirp(file, 0755, function (err) { 11 | if (err) t.fail(err); 12 | else path.exists(file, function (ex) { 13 | if (!ex) t.fail('file not created') 14 | else fs.stat(file, function (err, stat) { 15 | if (err) t.fail(err) 16 | else { 17 | t.equal(stat.mode & 0777, 0755); 18 | t.ok(stat.isDirectory(), 'target not a directory'); 19 | t.end(); 20 | } 21 | }) 22 | }) 23 | }); 24 | }); 25 | 26 | test('async root perm', function (t) { 27 | mkdirp('/tmp', 0755, function (err) { 28 | if (err) t.fail(err); 29 | t.end(); 30 | }); 31 | t.end(); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('sync perm', function (t) { 7 | t.plan(2); 8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; 9 | 10 | mkdirp.sync(file, 0755); 11 | path.exists(file, function (ex) { 12 | if (!ex) t.fail('file not created') 13 | else fs.stat(file, function (err, stat) { 14 | if (err) t.fail(err) 15 | else { 16 | t.equal(stat.mode & 0777, 0755); 17 | t.ok(stat.isDirectory(), 'target not a directory'); 18 | t.end(); 19 | } 20 | }) 21 | }); 22 | }); 23 | 24 | test('sync root perm', function (t) { 25 | t.plan(1); 26 | 27 | var file = '/tmp'; 28 | mkdirp.sync(file, 0755); 29 | path.exists(file, function (ex) { 30 | if (!ex) t.fail('file not created') 31 | else fs.stat(file, function (err, stat) { 32 | if (err) t.fail(err) 33 | else { 34 | t.ok(stat.isDirectory(), 'target not a directory'); 35 | t.end(); 36 | } 37 | }) 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('race', function (t) { 7 | t.plan(4); 8 | var ps = [ '', 'tmp' ]; 9 | 10 | for (var i = 0; i < 25; i++) { 11 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | ps.push(dir); 13 | } 14 | var file = ps.join('/'); 15 | 16 | var res = 2; 17 | mk(file, function () { 18 | if (--res === 0) t.end(); 19 | }); 20 | 21 | mk(file, function () { 22 | if (--res === 0) t.end(); 23 | }); 24 | 25 | function mk (file, cb) { 26 | mkdirp(file, 0755, function (err) { 27 | if (err) t.fail(err); 28 | else path.exists(file, function (ex) { 29 | if (!ex) t.fail('file not created') 30 | else fs.stat(file, function (err, stat) { 31 | if (err) t.fail(err) 32 | else { 33 | t.equal(stat.mode & 0777, 0755); 34 | t.ok(stat.isDirectory(), 'target not a directory'); 35 | if (cb) cb(); 36 | } 37 | }) 38 | }) 39 | }); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('rel', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var cwd = process.cwd(); 13 | process.chdir('/tmp'); 14 | 15 | var file = [x,y,z].join('/'); 16 | 17 | mkdirp(file, 0755, function (err) { 18 | if (err) t.fail(err); 19 | else path.exists(file, function (ex) { 20 | if (!ex) t.fail('file not created') 21 | else fs.stat(file, function (err, stat) { 22 | if (err) t.fail(err) 23 | else { 24 | process.chdir(cwd); 25 | t.equal(stat.mode & 0777, 0755); 26 | t.ok(stat.isDirectory(), 'target not a directory'); 27 | t.end(); 28 | } 29 | }) 30 | }) 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('sync', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | var err = mkdirp.sync(file, 0755); 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, 0755); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('implicit mode from umask', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | mkdirp(file, function (err) { 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, 0777 & (~process.umask())); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('umask sync modes', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | var err = mkdirp.sync(file); 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, (0777 & (~process.umask()))); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jade", 3 | "description": "Jade template engine", 4 | "version": "0.26.3", 5 | "author": { 6 | "name": "TJ Holowaychuk", 7 | "email": "tj@vision-media.ca" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/visionmedia/jade.git" 12 | }, 13 | "main": "./index.js", 14 | "bin": { 15 | "jade": "./bin/jade" 16 | }, 17 | "man": [ 18 | "./jade.1" 19 | ], 20 | "dependencies": { 21 | "commander": "0.6.1", 22 | "mkdirp": "0.3.0" 23 | }, 24 | "devDependencies": { 25 | "mocha": "*", 26 | "markdown": "*", 27 | "stylus": "*", 28 | "uubench": "*", 29 | "should": "*", 30 | "less": "*", 31 | "uglify-js": "*" 32 | }, 33 | "component": { 34 | "scripts": { 35 | "jade": "runtime.js" 36 | } 37 | }, 38 | "scripts": { 39 | "prepublish": "npm prune" 40 | }, 41 | "_id": "jade@0.26.3", 42 | "dist": { 43 | "shasum": "8f10d7977d8d79f2f6ff862a81b0513ccb25686c", 44 | "tarball": "http://registry.npmjs.org/jade/-/jade-0.26.3.tgz" 45 | }, 46 | "maintainers": [ 47 | { 48 | "name": "tjholowaychuk", 49 | "email": "tj@vision-media.ca" 50 | } 51 | ], 52 | "directories": {}, 53 | "_shasum": "8f10d7977d8d79f2f6ff862a81b0513ccb25686c", 54 | "_resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", 55 | "_from": "jade@0.26.3", 56 | "bugs": { 57 | "url": "https://github.com/visionmedia/jade/issues" 58 | }, 59 | "readme": "ERROR: No README data found!", 60 | "homepage": "https://github.com/visionmedia/jade#readme" 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/test.jade: -------------------------------------------------------------------------------- 1 | p. 2 | This is a large 3 | body of text for 4 | this tag. 5 | 6 | Nothing too 7 | exciting. -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/testing/head.jade: -------------------------------------------------------------------------------- 1 | head 2 | script(src='/jquery.js') 3 | yield 4 | if false 5 | script(src='/jquery.ui.js') 6 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/testing/index.jade: -------------------------------------------------------------------------------- 1 | 2 | tag = 'p' 3 | foo = 'bar' 4 | 5 | #{tag} value 6 | #{tag}(foo='bar') value 7 | #{foo ? 'a' : 'li'}(something) here 8 | 9 | mixin item(icon) 10 | li 11 | if attributes.href 12 | a(attributes) 13 | img.icon(src=icon) 14 | block 15 | else 16 | span(attributes) 17 | img.icon(src=icon) 18 | block 19 | 20 | ul 21 | +item('contact') Contact 22 | +item(href='/contact') Contact 23 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/testing/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var jade = require('../'); 7 | 8 | jade.renderFile('testing/index.jade', { pretty: true, debug: true, compileDebug: false }, function(err, str){ 9 | if (err) throw err; 10 | console.log(str); 11 | }); -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/testing/layout.jade: -------------------------------------------------------------------------------- 1 | html 2 | include head 3 | script(src='/caustic.js') 4 | script(src='/app.js') 5 | body 6 | block content -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/testing/user.jade: -------------------------------------------------------------------------------- 1 | h1 Tobi 2 | p Is a ferret 3 | 4 | ul 5 | li: a foo 6 | li: a bar 7 | li: a baz -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/jade/testing/user.js: -------------------------------------------------------------------------------- 1 | function anonymous(locals, attrs, escape, rethrow) { 2 | var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow; 3 | var __jade = [{ lineno: 1, filename: "testing/user.jade" }]; 4 | try { 5 | var buf = []; 6 | with (locals || {}) { 7 | var interp; 8 | __jade.unshift({ lineno: 1, filename: __jade[0].filename }); 9 | __jade.unshift({ lineno: 1, filename: __jade[0].filename }); 10 | buf.push('

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

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

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

'); 20 | __jade.shift(); 21 | __jade.shift(); 22 | } 23 | return buf.join(""); 24 | } catch (err) { 25 | rethrow(err, __jade[0].filename, __jade[0].lineno); 26 | } 27 | } -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | - "0.10" 6 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 James Halliday (mail@substack.net) 2 | 3 | This project is free software released under the MIT/X11 license: 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/bin/cmd.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var mkdirp = require('../'); 4 | var minimist = require('minimist'); 5 | var fs = require('fs'); 6 | 7 | var argv = minimist(process.argv.slice(2), { 8 | alias: { m: 'mode', h: 'help' }, 9 | string: [ 'mode' ] 10 | }); 11 | if (argv.help) { 12 | fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); 13 | return; 14 | } 15 | 16 | var paths = argv._.slice(); 17 | var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; 18 | 19 | (function next () { 20 | if (paths.length === 0) return; 21 | var p = paths.shift(); 22 | 23 | if (mode === undefined) mkdirp(p, cb) 24 | else mkdirp(p, mode, cb) 25 | 26 | function cb (err) { 27 | if (err) { 28 | console.error(err.message); 29 | process.exit(1); 30 | } 31 | else next(); 32 | } 33 | })(); 34 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/bin/usage.txt: -------------------------------------------------------------------------------- 1 | usage: mkdirp [DIR1,DIR2..] {OPTIONS} 2 | 3 | Create each supplied directory including any necessary parent directories that 4 | don't yet exist. 5 | 6 | If the directory already exists, do nothing. 7 | 8 | OPTIONS are: 9 | 10 | -m, --mode If a directory needs to be created, set the mode as an octal 11 | permission string. 12 | 13 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/examples/pow.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/example/parse.js: -------------------------------------------------------------------------------- 1 | var argv = require('../')(process.argv.slice(2)); 2 | console.dir(argv); 3 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/test/dash.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('-', function (t) { 5 | t.plan(5); 6 | t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); 7 | t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); 8 | t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); 9 | t.deepEqual( 10 | parse([ '-b', '-' ], { boolean: 'b' }), 11 | { b: true, _: [ '-' ] } 12 | ); 13 | t.deepEqual( 14 | parse([ '-s', '-' ], { string: 's' }), 15 | { s: '-', _: [] } 16 | ); 17 | }); 18 | 19 | test('-a -- b', function (t) { 20 | t.plan(3); 21 | t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); 22 | t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); 23 | t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); 24 | }); 25 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/test/default_bool.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var parse = require('../'); 3 | 4 | test('boolean default true', function (t) { 5 | var argv = parse([], { 6 | boolean: 'sometrue', 7 | default: { sometrue: true } 8 | }); 9 | t.equal(argv.sometrue, true); 10 | t.end(); 11 | }); 12 | 13 | test('boolean default false', function (t) { 14 | var argv = parse([], { 15 | boolean: 'somefalse', 16 | default: { somefalse: false } 17 | }); 18 | t.equal(argv.somefalse, false); 19 | t.end(); 20 | }); 21 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/test/dotted.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('dotted alias', function (t) { 5 | var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); 6 | t.equal(argv.a.b, 22); 7 | t.equal(argv.aa.bb, 22); 8 | t.end(); 9 | }); 10 | 11 | test('dotted default', function (t) { 12 | var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); 13 | t.equal(argv.a.b, 11); 14 | t.equal(argv.aa.bb, 11); 15 | t.end(); 16 | }); 17 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/test/long.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var parse = require('../'); 3 | 4 | test('long opts', function (t) { 5 | t.deepEqual( 6 | parse([ '--bool' ]), 7 | { bool : true, _ : [] }, 8 | 'long boolean' 9 | ); 10 | t.deepEqual( 11 | parse([ '--pow', 'xixxle' ]), 12 | { pow : 'xixxle', _ : [] }, 13 | 'long capture sp' 14 | ); 15 | t.deepEqual( 16 | parse([ '--pow=xixxle' ]), 17 | { pow : 'xixxle', _ : [] }, 18 | 'long capture eq' 19 | ); 20 | t.deepEqual( 21 | parse([ '--host', 'localhost', '--port', '555' ]), 22 | { host : 'localhost', port : 555, _ : [] }, 23 | 'long captures sp' 24 | ); 25 | t.deepEqual( 26 | parse([ '--host=localhost', '--port=555' ]), 27 | { host : 'localhost', port : 555, _ : [] }, 28 | 'long captures eq' 29 | ); 30 | t.end(); 31 | }); 32 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('parse with modifier functions' , function (t) { 5 | t.plan(1); 6 | 7 | var argv = parse([ '-b', '123' ], { boolean: 'b' }); 8 | t.deepEqual(argv, { b: true, _: ['123'] }); 9 | }); 10 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/node_modules/minimist/test/whitespace.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('whitespace should be whitespace' , function (t) { 5 | t.plan(1); 6 | var x = parse([ '-x', '\t' ]).x; 7 | t.equal(x, '\t'); 8 | }); 9 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mkdirp", 3 | "description": "Recursively mkdir, like `mkdir -p`", 4 | "version": "0.5.0", 5 | "author": { 6 | "name": "James Halliday", 7 | "email": "mail@substack.net", 8 | "url": "http://substack.net" 9 | }, 10 | "main": "./index", 11 | "keywords": [ 12 | "mkdir", 13 | "directory" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/substack/node-mkdirp.git" 18 | }, 19 | "scripts": { 20 | "test": "tap test/*.js" 21 | }, 22 | "dependencies": { 23 | "minimist": "0.0.8" 24 | }, 25 | "devDependencies": { 26 | "tap": "~0.4.0", 27 | "mock-fs": "~2.2.0" 28 | }, 29 | "bin": { 30 | "mkdirp": "bin/cmd.js" 31 | }, 32 | "license": "MIT", 33 | "bugs": { 34 | "url": "https://github.com/substack/node-mkdirp/issues" 35 | }, 36 | "homepage": "https://github.com/substack/node-mkdirp", 37 | "_id": "mkdirp@0.5.0", 38 | "dist": { 39 | "shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", 40 | "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz" 41 | }, 42 | "_from": "mkdirp@0.5.0", 43 | "_npmVersion": "1.4.3", 44 | "_npmUser": { 45 | "name": "substack", 46 | "email": "mail@substack.net" 47 | }, 48 | "maintainers": [ 49 | { 50 | "name": "substack", 51 | "email": "mail@substack.net" 52 | } 53 | ], 54 | "directories": {}, 55 | "_shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", 56 | "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", 57 | "readme": "ERROR: No README data found!" 58 | } 59 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/chmod.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | var ps = [ '', 'tmp' ]; 7 | 8 | for (var i = 0; i < 25; i++) { 9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | ps.push(dir); 11 | } 12 | 13 | var file = ps.join('/'); 14 | 15 | test('chmod-pre', function (t) { 16 | var mode = 0744 17 | mkdirp(file, mode, function (er) { 18 | t.ifError(er, 'should not error'); 19 | fs.stat(file, function (er, stat) { 20 | t.ifError(er, 'should exist'); 21 | t.ok(stat && stat.isDirectory(), 'should be directory'); 22 | t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); 23 | t.end(); 24 | }); 25 | }); 26 | }); 27 | 28 | test('chmod', function (t) { 29 | var mode = 0755 30 | mkdirp(file, mode, function (er) { 31 | t.ifError(er, 'should not error'); 32 | fs.stat(file, function (er, stat) { 33 | t.ifError(er, 'should exist'); 34 | t.ok(stat && stat.isDirectory(), 'should be directory'); 35 | t.end(); 36 | }); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/clobber.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | var ps = [ '', 'tmp' ]; 7 | 8 | for (var i = 0; i < 25; i++) { 9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | ps.push(dir); 11 | } 12 | 13 | var file = ps.join('/'); 14 | 15 | // a file in the way 16 | var itw = ps.slice(0, 3).join('/'); 17 | 18 | 19 | test('clobber-pre', function (t) { 20 | console.error("about to write to "+itw) 21 | fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); 22 | 23 | fs.stat(itw, function (er, stat) { 24 | t.ifError(er) 25 | t.ok(stat && stat.isFile(), 'should be file') 26 | t.end() 27 | }) 28 | }) 29 | 30 | test('clobber', function (t) { 31 | t.plan(2); 32 | mkdirp(file, 0755, function (err) { 33 | t.ok(err); 34 | t.equal(err.code, 'ENOTDIR'); 35 | t.end(); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/mkdirp.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('woo', function (t) { 8 | t.plan(5); 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var file = '/tmp/' + [x,y,z].join('/'); 14 | 15 | mkdirp(file, 0755, function (err) { 16 | t.ifError(err); 17 | exists(file, function (ex) { 18 | t.ok(ex, 'file created'); 19 | fs.stat(file, function (err, stat) { 20 | t.ifError(err); 21 | t.equal(stat.mode & 0777, 0755); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | }) 24 | }) 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/opts_fs.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var test = require('tap').test; 4 | var mockfs = require('mock-fs'); 5 | 6 | test('opts.fs', function (t) { 7 | t.plan(5); 8 | 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var file = '/beep/boop/' + [x,y,z].join('/'); 14 | var xfs = mockfs.fs(); 15 | 16 | mkdirp(file, { fs: xfs, mode: 0755 }, function (err) { 17 | t.ifError(err); 18 | xfs.exists(file, function (ex) { 19 | t.ok(ex, 'created file'); 20 | xfs.stat(file, function (err, stat) { 21 | t.ifError(err); 22 | t.equal(stat.mode & 0777, 0755); 23 | t.ok(stat.isDirectory(), 'target not a directory'); 24 | }); 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/opts_fs_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var test = require('tap').test; 4 | var mockfs = require('mock-fs'); 5 | 6 | test('opts.fs sync', function (t) { 7 | t.plan(4); 8 | 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var file = '/beep/boop/' + [x,y,z].join('/'); 14 | var xfs = mockfs.fs(); 15 | 16 | mkdirp.sync(file, { fs: xfs, mode: 0755 }); 17 | xfs.exists(file, function (ex) { 18 | t.ok(ex, 'created file'); 19 | xfs.stat(file, function (err, stat) { 20 | t.ifError(err); 21 | t.equal(stat.mode & 0777, 0755); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/perm.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('async perm', function (t) { 8 | t.plan(5); 9 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); 10 | 11 | mkdirp(file, 0755, function (err) { 12 | t.ifError(err); 13 | exists(file, function (ex) { 14 | t.ok(ex, 'file created'); 15 | fs.stat(file, function (err, stat) { 16 | t.ifError(err); 17 | t.equal(stat.mode & 0777, 0755); 18 | t.ok(stat.isDirectory(), 'target not a directory'); 19 | }) 20 | }) 21 | }); 22 | }); 23 | 24 | test('async root perm', function (t) { 25 | mkdirp('/tmp', 0755, function (err) { 26 | if (err) t.fail(err); 27 | t.end(); 28 | }); 29 | t.end(); 30 | }); 31 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/perm_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('sync perm', function (t) { 8 | t.plan(4); 9 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; 10 | 11 | mkdirp.sync(file, 0755); 12 | exists(file, function (ex) { 13 | t.ok(ex, 'file created'); 14 | fs.stat(file, function (err, stat) { 15 | t.ifError(err); 16 | t.equal(stat.mode & 0777, 0755); 17 | t.ok(stat.isDirectory(), 'target not a directory'); 18 | }); 19 | }); 20 | }); 21 | 22 | test('sync root perm', function (t) { 23 | t.plan(3); 24 | 25 | var file = '/tmp'; 26 | mkdirp.sync(file, 0755); 27 | exists(file, function (ex) { 28 | t.ok(ex, 'file created'); 29 | fs.stat(file, function (err, stat) { 30 | t.ifError(err); 31 | t.ok(stat.isDirectory(), 'target not a directory'); 32 | }) 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/race.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('race', function (t) { 8 | t.plan(6); 9 | var ps = [ '', 'tmp' ]; 10 | 11 | for (var i = 0; i < 25; i++) { 12 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 13 | ps.push(dir); 14 | } 15 | var file = ps.join('/'); 16 | 17 | var res = 2; 18 | mk(file, function () { 19 | if (--res === 0) t.end(); 20 | }); 21 | 22 | mk(file, function () { 23 | if (--res === 0) t.end(); 24 | }); 25 | 26 | function mk (file, cb) { 27 | mkdirp(file, 0755, function (err) { 28 | t.ifError(err); 29 | exists(file, function (ex) { 30 | t.ok(ex, 'file created'); 31 | fs.stat(file, function (err, stat) { 32 | t.ifError(err); 33 | t.equal(stat.mode & 0777, 0755); 34 | t.ok(stat.isDirectory(), 'target not a directory'); 35 | if (cb) cb(); 36 | }); 37 | }) 38 | }); 39 | } 40 | }); 41 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/rel.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('rel', function (t) { 8 | t.plan(5); 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var cwd = process.cwd(); 14 | process.chdir('/tmp'); 15 | 16 | var file = [x,y,z].join('/'); 17 | 18 | mkdirp(file, 0755, function (err) { 19 | t.ifError(err); 20 | exists(file, function (ex) { 21 | t.ok(ex, 'file created'); 22 | fs.stat(file, function (err, stat) { 23 | t.ifError(err); 24 | process.chdir(cwd); 25 | t.equal(stat.mode & 0777, 0755); 26 | t.ok(stat.isDirectory(), 'target not a directory'); 27 | }) 28 | }) 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/return.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('return value', function (t) { 7 | t.plan(4); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | // should return the first dir created. 15 | // By this point, it would be profoundly surprising if /tmp didn't 16 | // already exist, since every other test makes things in there. 17 | mkdirp(file, function (err, made) { 18 | t.ifError(err); 19 | t.equal(made, '/tmp/' + x); 20 | mkdirp(file, function (err, made) { 21 | t.ifError(err); 22 | t.equal(made, null); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/return_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('return value', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | // should return the first dir created. 15 | // By this point, it would be profoundly surprising if /tmp didn't 16 | // already exist, since every other test makes things in there. 17 | // Note that this will throw on failure, which will fail the test. 18 | var made = mkdirp.sync(file); 19 | t.equal(made, '/tmp/' + x); 20 | 21 | // making the same file again should have no effect. 22 | made = mkdirp.sync(file); 23 | t.equal(made, null); 24 | }); 25 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/root.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('root', function (t) { 7 | // '/' on unix, 'c:/' on windows. 8 | var file = path.resolve('/'); 9 | 10 | mkdirp(file, 0755, function (err) { 11 | if (err) throw err 12 | fs.stat(file, function (er, stat) { 13 | if (er) throw er 14 | t.ok(stat.isDirectory(), 'target is a directory'); 15 | t.end(); 16 | }) 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('sync', function (t) { 8 | t.plan(4); 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var file = '/tmp/' + [x,y,z].join('/'); 14 | 15 | try { 16 | mkdirp.sync(file, 0755); 17 | } catch (err) { 18 | t.fail(err); 19 | return t.end(); 20 | } 21 | 22 | exists(file, function (ex) { 23 | t.ok(ex, 'file created'); 24 | fs.stat(file, function (err, stat) { 25 | t.ifError(err); 26 | t.equal(stat.mode & 0777, 0755); 27 | t.ok(stat.isDirectory(), 'target not a directory'); 28 | }); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/umask.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('implicit mode from umask', function (t) { 8 | t.plan(5); 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var file = '/tmp/' + [x,y,z].join('/'); 14 | 15 | mkdirp(file, function (err) { 16 | t.ifError(err); 17 | exists(file, function (ex) { 18 | t.ok(ex, 'file created'); 19 | fs.stat(file, function (err, stat) { 20 | t.ifError(err); 21 | t.equal(stat.mode & 0777, 0777 & (~process.umask())); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | }); 24 | }) 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/mkdirp/test/umask_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var exists = fs.exists || path.exists; 5 | var test = require('tap').test; 6 | 7 | test('umask sync modes', function (t) { 8 | t.plan(4); 9 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | 13 | var file = '/tmp/' + [x,y,z].join('/'); 14 | 15 | try { 16 | mkdirp.sync(file); 17 | } catch (err) { 18 | t.fail(err); 19 | return t.end(); 20 | } 21 | 22 | exists(file, function (ex) { 23 | t.ok(ex, 'file created'); 24 | fs.stat(file, function (err, stat) { 25 | t.ifError(err); 26 | t.equal(stat.mode & 0777, (0777 & (~process.umask()))); 27 | t.ok(stat.isDirectory(), 'target not a directory'); 28 | }); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/supports-color/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict'; 3 | var pkg = require('./package.json'); 4 | var supportsColor = require('./'); 5 | var argv = process.argv.slice(2); 6 | 7 | function help() { 8 | console.log([ 9 | '', 10 | ' ' + pkg.description, 11 | '', 12 | ' Usage', 13 | ' supports-color', 14 | '', 15 | ' Exits with code 0 if color is supported and 1 if not' 16 | ].join('\n')); 17 | } 18 | 19 | if (argv.indexOf('--help') !== -1) { 20 | help(); 21 | return; 22 | } 23 | 24 | if (argv.indexOf('--version') !== -1) { 25 | console.log(pkg.version); 26 | return; 27 | } 28 | 29 | process.exit(supportsColor ? 0 : 1); 30 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/supports-color/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var argv = process.argv; 3 | 4 | module.exports = (function () { 5 | if (argv.indexOf('--no-color') !== -1 || 6 | argv.indexOf('--no-colors') !== -1 || 7 | argv.indexOf('--color=false') !== -1) { 8 | return false; 9 | } 10 | 11 | if (argv.indexOf('--color') !== -1 || 12 | argv.indexOf('--colors') !== -1 || 13 | argv.indexOf('--color=true') !== -1 || 14 | argv.indexOf('--color=always') !== -1) { 15 | return true; 16 | } 17 | 18 | if (process.stdout && !process.stdout.isTTY) { 19 | return false; 20 | } 21 | 22 | if (process.platform === 'win32') { 23 | return true; 24 | } 25 | 26 | if ('COLORTERM' in process.env) { 27 | return true; 28 | } 29 | 30 | if (process.env.TERM === 'dumb') { 31 | return false; 32 | } 33 | 34 | if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { 35 | return true; 36 | } 37 | 38 | return false; 39 | })(); 40 | -------------------------------------------------------------------------------- /node_modules/mocha/node_modules/supports-color/readme.md: -------------------------------------------------------------------------------- 1 | # supports-color [![Build Status](https://travis-ci.org/sindresorhus/supports-color.svg?branch=master)](https://travis-ci.org/sindresorhus/supports-color) 2 | 3 | > Detect whether a terminal supports color 4 | 5 | 6 | ## Install 7 | 8 | ```sh 9 | $ npm install --save supports-color 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var supportsColor = require('supports-color'); 17 | 18 | if (supportsColor) { 19 | console.log('Terminal supports color'); 20 | } 21 | ``` 22 | 23 | It obeys the `--color` and `--no-color` CLI flags. 24 | 25 | 26 | ## CLI 27 | 28 | ```sh 29 | $ npm install --global supports-color 30 | ``` 31 | 32 | ``` 33 | $ supports-color --help 34 | 35 | Usage 36 | supports-color 37 | 38 | Exits with code 0 if color is supported and 1 if not 39 | ``` 40 | 41 | 42 | ## License 43 | 44 | MIT © [Sindre Sorhus](http://sindresorhus.com) 45 | -------------------------------------------------------------------------------- /node_modules/sinon/LICENSE: -------------------------------------------------------------------------------- 1 | (The BSD License) 2 | 3 | Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, 7 | are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | * Neither the name of Christian Johansen nor the names of his contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/sinon/lib/sinon.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sinon core utilities. For internal use only. 3 | * 4 | * @author Christian Johansen (christian@cjohansen.no) 5 | * @license BSD 6 | * 7 | * Copyright (c) 2010-2013 Christian Johansen 8 | */ 9 | var sinon = (function () { // eslint-disable-line no-unused-vars 10 | "use strict"; 11 | 12 | var sinonModule; 13 | var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; 14 | var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; 15 | 16 | function loadDependencies(require, exports, module) { 17 | sinonModule = module.exports = require("./sinon/util/core"); 18 | require("./sinon/extend"); 19 | require("./sinon/walk"); 20 | require("./sinon/typeOf"); 21 | require("./sinon/times_in_words"); 22 | require("./sinon/spy"); 23 | require("./sinon/call"); 24 | require("./sinon/behavior"); 25 | require("./sinon/stub"); 26 | require("./sinon/mock"); 27 | require("./sinon/collection"); 28 | require("./sinon/assert"); 29 | require("./sinon/sandbox"); 30 | require("./sinon/test"); 31 | require("./sinon/test_case"); 32 | require("./sinon/match"); 33 | require("./sinon/format"); 34 | require("./sinon/log_error"); 35 | } 36 | 37 | if (isAMD) { 38 | define(loadDependencies); 39 | } else if (isNode) { 40 | loadDependencies(require, module.exports, module); 41 | sinonModule = module.exports; 42 | } else { 43 | sinonModule = {}; 44 | } 45 | 46 | return sinonModule; 47 | }()); 48 | -------------------------------------------------------------------------------- /node_modules/sinon/lib/sinon/times_in_words.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @depend util/core.js 3 | */ 4 | (function (sinonGlobal) { 5 | "use strict"; 6 | 7 | function makeApi(sinon) { 8 | 9 | function timesInWords(count) { 10 | switch (count) { 11 | case 1: 12 | return "once"; 13 | case 2: 14 | return "twice"; 15 | case 3: 16 | return "thrice"; 17 | default: 18 | return (count || 0) + " times"; 19 | } 20 | } 21 | 22 | sinon.timesInWords = timesInWords; 23 | return sinon.timesInWords; 24 | } 25 | 26 | function loadDependencies(require, exports, module) { 27 | var core = require("./util/core"); 28 | module.exports = makeApi(core); 29 | } 30 | 31 | var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; 32 | var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; 33 | 34 | if (isAMD) { 35 | define(loadDependencies); 36 | return; 37 | } 38 | 39 | if (isNode) { 40 | loadDependencies(require, module.exports, module); 41 | return; 42 | } 43 | 44 | if (sinonGlobal) { 45 | makeApi(sinonGlobal); 46 | } 47 | }( 48 | typeof sinon === "object" && sinon // eslint-disable-line no-undef 49 | )); 50 | -------------------------------------------------------------------------------- /node_modules/sinon/lib/sinon/typeOf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @depend util/core.js 3 | */ 4 | /** 5 | * Format functions 6 | * 7 | * @author Christian Johansen (christian@cjohansen.no) 8 | * @license BSD 9 | * 10 | * Copyright (c) 2010-2014 Christian Johansen 11 | */ 12 | (function (sinonGlobal) { 13 | "use strict"; 14 | 15 | function makeApi(sinon) { 16 | function typeOf(value) { 17 | if (value === null) { 18 | return "null"; 19 | } else if (value === undefined) { 20 | return "undefined"; 21 | } 22 | var string = Object.prototype.toString.call(value); 23 | return string.substring(8, string.length - 1).toLowerCase(); 24 | } 25 | 26 | sinon.typeOf = typeOf; 27 | return sinon.typeOf; 28 | } 29 | 30 | function loadDependencies(require, exports, module) { 31 | var core = require("./util/core"); 32 | module.exports = makeApi(core); 33 | } 34 | 35 | var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; 36 | var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; 37 | 38 | if (isAMD) { 39 | define(loadDependencies); 40 | return; 41 | } 42 | 43 | if (isNode) { 44 | loadDependencies(require, module.exports, module); 45 | return; 46 | } 47 | 48 | if (sinonGlobal) { 49 | makeApi(sinonGlobal); 50 | } 51 | }( 52 | typeof sinon === "object" && sinon // eslint-disable-line no-undef 53 | )); 54 | -------------------------------------------------------------------------------- /node_modules/sinon/lib/sinon/util/timers_ie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Helps IE run the fake timers. By defining global functions, IE allows 3 | * them to be overwritten at a later point. If these are not defined like 4 | * this, overwriting them will result in anything from an exception to browser 5 | * crash. 6 | * 7 | * If you don't require fake timers to work in IE, don't include this file. 8 | * 9 | * @author Christian Johansen (christian@cjohansen.no) 10 | * @license BSD 11 | * 12 | * Copyright (c) 2010-2013 Christian Johansen 13 | */ 14 | /*eslint-disable strict, no-inner-declarations, no-unused-vars*/ 15 | if (typeof window !== "undefined") { 16 | function setTimeout() {} 17 | function clearTimeout() {} 18 | function setImmediate() {} 19 | function clearImmediate() {} 20 | function setInterval() {} 21 | function clearInterval() {} 22 | function Date() {} 23 | 24 | // Reassign the original functions. Now their writable attribute 25 | // should be true. Hackish, I know, but it works. 26 | /*global sinon*/ 27 | setTimeout = sinon.timers.setTimeout; 28 | clearTimeout = sinon.timers.clearTimeout; 29 | setImmediate = sinon.timers.setImmediate; 30 | clearImmediate = sinon.timers.clearImmediate; 31 | setInterval = sinon.timers.setInterval; 32 | clearInterval = sinon.timers.clearInterval; 33 | Date = sinon.timers.Date; // eslint-disable-line no-native-reassign 34 | } 35 | /*eslint-enable no-inner-declarations*/ 36 | -------------------------------------------------------------------------------- /node_modules/sinon/lib/sinon/util/xdr_ie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Helps IE run the fake XDomainRequest. By defining global functions, IE allows 3 | * them to be overwritten at a later point. If these are not defined like 4 | * this, overwriting them will result in anything from an exception to browser 5 | * crash. 6 | * 7 | * If you don't require fake XDR to work in IE, don't include this file. 8 | */ 9 | /*eslint-disable strict*/ 10 | if (typeof window !== "undefined") { 11 | function XDomainRequest() {} // eslint-disable-line no-unused-vars, no-inner-declarations 12 | 13 | // Reassign the original function. Now its writable attribute 14 | // should be true. Hackish, I know, but it works. 15 | /*global sinon*/ 16 | XDomainRequest = sinon.xdr.XDomainRequest || undefined; 17 | } 18 | /*eslint-enable strict*/ 19 | -------------------------------------------------------------------------------- /node_modules/sinon/lib/sinon/util/xhr_ie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Helps IE run the fake XMLHttpRequest. By defining global functions, IE allows 3 | * them to be overwritten at a later point. If these are not defined like 4 | * this, overwriting them will result in anything from an exception to browser 5 | * crash. 6 | * 7 | * If you don't require fake XHR to work in IE, don't include this file. 8 | * 9 | * @author Christian Johansen (christian@cjohansen.no) 10 | * @license BSD 11 | * 12 | * Copyright (c) 2010-2013 Christian Johansen 13 | */ 14 | /*eslint-disable strict*/ 15 | if (typeof window !== "undefined") { 16 | function XMLHttpRequest() {} // eslint-disable-line no-unused-vars, no-inner-declarations 17 | 18 | // Reassign the original function. Now its writable attribute 19 | // should be true. Hackish, I know, but it works. 20 | /*global sinon*/ 21 | XMLHttpRequest = sinon.xhr.XMLHttpRequest || undefined; 22 | } 23 | /*eslint-enable strict*/ 24 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/formatio/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 4 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/formatio/AUTHORS: -------------------------------------------------------------------------------- 1 | Buster.JS Format was written by 2 | Christian Johansen, christian@cjohansen.no 3 | August Lilleaas, august.lilleaas@gmail.com 4 | Dave Geddes, davidcgeddes@gmail.com 5 | Stein Magnus Jodal, stein.magnus@jodal.no 6 | Tek Nynja, github@teknynja.com 7 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/formatio/LICENSE: -------------------------------------------------------------------------------- 1 | (The BSD License) 2 | 3 | Copyright (c) 2010-2012, Christian Johansen (christian@cjohansen.no) and 4 | August Lilleaas (august.lilleaas@gmail.com). All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, 7 | are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | * Neither the name of Christian Johansen nor the names of his contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/formatio/autolint.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | paths: [ 3 | "lib/*.js", 4 | "test/*.js" 5 | ], 6 | linterOptions: { 7 | node: true, 8 | browser: true, 9 | plusplus: true, 10 | vars: true, 11 | nomen: true, 12 | forin: true, 13 | sloppy: true, 14 | regexp: true, 15 | predef: [ 16 | "samsam", 17 | "define", 18 | "assert", 19 | "refute", 20 | "buster" 21 | ] 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/formatio/buster.js: -------------------------------------------------------------------------------- 1 | exports["Browser"] = { 2 | // TODO: Needs fixing 3 | environment: "browser", 4 | libs: [ 5 | "node_modules/samsam/lib/samsam.js" 6 | ], 7 | sources: ["lib/*.js"], 8 | tests: ["test/*-test.js"] 9 | }; 10 | 11 | exports["Node"] = { 12 | extends: "Browser", 13 | environment: "node" 14 | }; 15 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/.editorconfig: -------------------------------------------------------------------------------- 1 | ; EditorConfig file: http://EditorConfig.org 2 | ; Install the "EditorConfig" plugin into your editor to use 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 4 12 | trim_trailing_whitespace = true 13 | 14 | # Matches the exact files either package.json or .travis.yml 15 | [{package.json, .travis.yml}] 16 | indent_style = space 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/.jslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "evil":true, 3 | "vars":true, 4 | "plusplus":true 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/.min-wd: -------------------------------------------------------------------------------- 1 | { 2 | "sauceLabs": true, 3 | "browsers": [{ 4 | "name": "chrome" 5 | }, { 6 | "name": "internet explorer", 7 | "version": "9", 8 | "url": "http://maxantoni.de/doctype.html" 9 | }, { 10 | "name": "internet explorer", 11 | "version": "10" 12 | }] 13 | } 14 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | sudo: false 4 | 5 | node_js: 6 | - "0.10" 7 | - "0.12" 8 | script: 9 | - "./script/ci-test.sh" 10 | 11 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 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. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/lolex/script/ci-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | 4 | npm run test-node 5 | npm run test-headless -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/samsam/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/samsam/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/samsam/AUTHORS: -------------------------------------------------------------------------------- 1 | Christian Johansen (christian@cjohansen.no) 2 | August Lilleaas (august@augustl.com) 3 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/samsam/LICENSE: -------------------------------------------------------------------------------- 1 | (The BSD License) 2 | 3 | Copyright (c) 2010-2012, Christian Johansen, christian@cjohansen.no and 4 | August Lilleaas, august.lilleaas@gmail.com. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, 7 | are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | * Neither the name of Christian Johansen nor the names of his contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/samsam/autolint.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | paths: [ 3 | "lib/*.js", 4 | "test/*.js" 5 | ], 6 | linterOptions: { 7 | node: true, 8 | browser: true, 9 | plusplus: true, 10 | vars: true, 11 | nomen: true, 12 | forin: true, 13 | sloppy: true, 14 | eqeq: true, 15 | predef: [ 16 | "_", 17 | "define", 18 | "assert", 19 | "refute", 20 | "buster" 21 | ] 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/samsam/jsTestDriver.conf: -------------------------------------------------------------------------------- 1 | server: http://localhost:4224 2 | 3 | load: 4 | - node_modules/sinon/lib/sinon.js 5 | - node_modules/sinon/lib/sinon/spy.js 6 | - lib/samsam.js 7 | - node_modules/buster-util/lib/buster-util/test-case.js 8 | - node_modules/buster-util/lib/buster-util/jstestdriver-shim.js 9 | - test/samsam-test.js 10 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.8' 4 | - '0.10' 5 | env: 6 | global: 7 | - secure: AdUubswCR68/eGD+WWjwTHgFbelwQGnNo81j1IOaUxKw+zgFPzSnFEEtDw7z98pWgg7p9DpCnyzzSnSllP40wq6AG19OwyUJjSLoZK57fp+r8zwTQwWiSqUgMu2YSMmKJPIO/aoSGpRQXT+L1nRrHoUJXgFodyIZgz40qzJeZjc= 8 | - secure: heQuxPVsQ7jBbssoVKimXDpqGjQFiucm6W5spoujmspjDG7oEcHD9ANo9++LoRPrsAmNx56SpMK5fNfVmYediw6SvhXm4Mxt56/fYCrLDBtgGG+1neCeffAi8z1rO8x48m77hcQ6YhbUL5R9uBimUjMX92fZcygAt8Rg804zjFo= 9 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/.zuul.yml: -------------------------------------------------------------------------------- 1 | ui: mocha-qunit 2 | browsers: 3 | - name: chrome 4 | version: 27..latest 5 | - name: firefox 6 | version: latest 7 | - name: safari 8 | version: latest 9 | - name: ie 10 | version: 9..latest 11 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to 4 | deal in the Software without restriction, including without limitation the 5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 6 | sell copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/README.md: -------------------------------------------------------------------------------- 1 | # util 2 | 3 | [![Build Status](https://travis-ci.org/defunctzombie/node-util.png?branch=master)](https://travis-ci.org/defunctzombie/node-util) 4 | 5 | node.js [util](http://nodejs.org/api/util.html) module as a module 6 | 7 | ## install via [npm](npmjs.org) 8 | 9 | ```shell 10 | npm install util 11 | ``` 12 | 13 | ## browser support 14 | 15 | This module also works in modern browsers. If you need legacy browser support you will need to polyfill ES5 features. 16 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 4 | "version": "2.0.1", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented", 11 | "inherits", 12 | "browser", 13 | "browserify" 14 | ], 15 | "main": "./inherits.js", 16 | "browser": "./inherits_browser.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/inherits.git" 20 | }, 21 | "license": "ISC", 22 | "scripts": { 23 | "test": "node test" 24 | }, 25 | "bugs": { 26 | "url": "https://github.com/isaacs/inherits/issues" 27 | }, 28 | "_id": "inherits@2.0.1", 29 | "dist": { 30 | "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", 31 | "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" 32 | }, 33 | "_from": "inherits@2.0.1", 34 | "_npmVersion": "1.3.8", 35 | "_npmUser": { 36 | "name": "isaacs", 37 | "email": "i@izs.me" 38 | }, 39 | "maintainers": [ 40 | { 41 | "name": "isaacs", 42 | "email": "i@izs.me" 43 | } 44 | ], 45 | "directories": {}, 46 | "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", 47 | "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", 48 | "readme": "ERROR: No README data found!", 49 | "homepage": "https://github.com/isaacs/inherits#readme" 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Joyent", 4 | "url": "http://www.joyent.com" 5 | }, 6 | "name": "util", 7 | "description": "Node.JS util module", 8 | "keywords": [ 9 | "util" 10 | ], 11 | "version": "0.10.3", 12 | "homepage": "https://github.com/defunctzombie/node-util", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/defunctzombie/node-util.git" 16 | }, 17 | "main": "./util.js", 18 | "scripts": { 19 | "test": "node test/node/*.js && zuul test/browser/*.js" 20 | }, 21 | "dependencies": { 22 | "inherits": "2.0.1" 23 | }, 24 | "license": "MIT", 25 | "devDependencies": { 26 | "zuul": "~1.0.9" 27 | }, 28 | "browser": { 29 | "./support/isBuffer.js": "./support/isBufferBrowser.js" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/defunctzombie/node-util/issues" 33 | }, 34 | "_id": "util@0.10.3", 35 | "dist": { 36 | "shasum": "7afb1afe50805246489e3db7fe0ed379336ac0f9", 37 | "tarball": "http://registry.npmjs.org/util/-/util-0.10.3.tgz" 38 | }, 39 | "_from": "util@>=0.10.3 <1.0.0", 40 | "_npmVersion": "1.3.24", 41 | "_npmUser": { 42 | "name": "shtylman", 43 | "email": "shtylman@gmail.com" 44 | }, 45 | "maintainers": [ 46 | { 47 | "name": "shtylman", 48 | "email": "shtylman@gmail.com" 49 | } 50 | ], 51 | "directories": {}, 52 | "_shasum": "7afb1afe50805246489e3db7fe0ed379336ac0f9", 53 | "_resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", 54 | "readme": "ERROR: No README data found!" 55 | } 56 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/support/isBuffer.js: -------------------------------------------------------------------------------- 1 | module.exports = function isBuffer(arg) { 2 | return arg instanceof Buffer; 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/sinon/node_modules/util/support/isBufferBrowser.js: -------------------------------------------------------------------------------- 1 | module.exports = function isBuffer(arg) { 2 | return arg && typeof arg === 'object' 3 | && typeof arg.copy === 'function' 4 | && typeof arg.fill === 'function' 5 | && typeof arg.readUInt8 === 'function'; 6 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "office-converter", 3 | "version": "1.0.0", 4 | "description": "A Conversion utility library for Office Files into PDF/HTML using https://github.com/dagwieers/unoconv", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "mocha --prof tests", 8 | "start": "node index.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/vworld4u/office-converter.git" 13 | }, 14 | "keywords": [ 15 | "office", 16 | "convert", 17 | "to", 18 | "pdf", 19 | "doc", 20 | "to", 21 | "html", 22 | "doc", 23 | "to", 24 | "pdf", 25 | "doc2html", 26 | "xltopdf", 27 | "xl", 28 | "to", 29 | "pdf", 30 | "xl2pdf", 31 | "ppt2pdf", 32 | "ppt2html" 33 | ], 34 | "author": "vworld4u@gmail.com", 35 | "license": "MIT", 36 | "bugs": { 37 | "url": "https://github.com/vworld4u/office-converter/issues" 38 | }, 39 | "homepage": "https://github.com/vworld4u/office-converter#readme", 40 | "devDependencies": { 41 | "chai": "^3.4.1", 42 | "mocha": "^2.3.4", 43 | "sinon": "^1.17.2" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/doc2html.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var converter = require('../index')(); 3 | var expect = require('chai').expect; 4 | 5 | describe('A docx file to HTML conversion should ', function() { 6 | it('create a HTML with same file name in the same directory', function (done) { 7 | converter.generateHtml('input/test.docx', function(err, result) { 8 | if (err) { 9 | console.log('Error '); 10 | console.error(err); 11 | } 12 | expect(result).to.not.be.undefined; 13 | expect(result.outputFile).to.not.be.undefined; 14 | expect(result.outputFile).to.have.string('test.pdf'); 15 | done(); 16 | }); 17 | }); 18 | 19 | it('throw some error if invalid file name is passed', function (done) { 20 | converter.generateHtml('../input/test1212912012323.doc', function(err, result) { 21 | if (!err) { 22 | console.log(result); 23 | } 24 | expect(err).to.not.be.undefined; 25 | done(); 26 | }); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /tests/doc2pdf.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var converter = require('../index')(); 3 | var expect = require('chai').expect; 4 | 5 | describe('A docx file to PDF conversion should ', function() { 6 | it('create a pdf with same file name in the same directory', function (done) { 7 | converter.generatePdf('input/test.docx', function(err, result) { 8 | if (err) { 9 | console.log('Error '); 10 | console.error(err); 11 | } 12 | expect(result).to.not.be.undefined; 13 | expect(result.outputFile).to.not.be.undefined; 14 | expect(result.outputFile).to.have.string('test.pdf'); 15 | done(); 16 | }); 17 | }); 18 | 19 | it('throw some error if invalid file name is passed', function (done) { 20 | converter.generatePdf('../input/test1212912012323.doc', function(err, result) { 21 | if (!err) { 22 | console.log(result); 23 | } 24 | expect(err).to.not.be.undefined; 25 | done(); 26 | }); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /tests/xl2pdf.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var converter = require('../index')(); 3 | var expect = require('chai').expect; 4 | 5 | describe('A XLSX file to PDF conversion should ', function() { 6 | it('create a pdf with same file name in the same directory', function (done) { 7 | converter.generatePdf('input/test.xls', function(err, result) { 8 | if (err) { 9 | console.log('Error '); 10 | console.error(err); 11 | } 12 | expect(result).to.not.be.undefined; 13 | expect(result.outputFile).to.not.be.undefined; 14 | expect(result.outputFile).to.have.string('test.pdf'); 15 | done(); 16 | }); 17 | }); 18 | 19 | it('throw some error if invalid file name is passed', function (done) { 20 | converter.generatePdf('../input/test1212912012323-invalidname.xlsx', function(err, result) { 21 | if (!err) { 22 | console.log(result); 23 | } 24 | expect(err).to.not.be.undefined; 25 | done(); 26 | }); 27 | }); 28 | }); 29 | --------------------------------------------------------------------------------