pax_global_header00006660000000000000000000000064137606350030014515gustar00rootroot0000000000000052 comment=03e819a1704471f66d837966f90724bd2203d700 gcd-1.2.1/000077500000000000000000000000001376063500300122535ustar00rootroot00000000000000gcd-1.2.1/.editorconfig000066400000000000000000000002511376063500300147260ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = falsegcd-1.2.1/.gitattributes000066400000000000000000000000141376063500300151410ustar00rootroot00000000000000* text=auto gcd-1.2.1/.gitignore000066400000000000000000000013071376063500300142440ustar00rootroot00000000000000 # Directories # ############### reports/ build/ # Compiled source # ################### *.com *.class *.dll *.exe *.o *.so # Packages # ############ # it's better to unpack these files and commit the raw source # git has its own built in compression methods *.7z *.dmg *.gz *.iso *.jar *.rar *.tar *.zip # Logs and databases # ###################### *.log *.sql *.sqlite # OS generated files # ###################### .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes Icon? ehthumbs.db Thumbs.db Desktop.ini # Temporary files # ################### *~ # Node.js # ########### /node_modules/ # Matlab # ########## # Windows default autosave extension *.asv # Compiled MEX binaries (all platforms) *.mex* gcd-1.2.1/.jshintignore000066400000000000000000000001661376063500300147620ustar00rootroot00000000000000 # Directories # ############### build/ reports/ dist/ # Node.js # ########### /node_modules/ # Git # ####### .git* gcd-1.2.1/.jshintrc000066400000000000000000000023471376063500300141060ustar00rootroot00000000000000{ "bitwise": false, "camelcase": false, "curly": true, "eqeqeq": true, "es3": false, "forin": true, "freeze": true, "immed": true, "indent": 4, "latedef": "nofunc", "newcap": true, "noarg": true, "noempty": false, "nonbsp": true, "nonew": true, "plusplus": false, "quotmark": "single", "undef": true, "unused": true, "strict": true, "maxparams": 10, "maxdepth": 5, "maxstatements": 100, "maxcomplexity": false, "maxlen": 1000, "asi": false, "boss": false, "debug": false, "eqnull": false, "esnext": false, "evil": false, "expr": false, "funcscope": false, "globalstrict": false, "iterator": false, "lastsemic": false, "laxbreak": false, "laxcomma": false, "loopfunc": false, "maxerr": 1000, "moz": false, "multistr": false, "notypeof": false, "proto": false, "scripturl": false, "shadow": false, "sub": true, "supernew": false, "validthis": false, "noyield": false, "browser": true, "browserify": true, "couch": false, "devel": true, "dojo": false, "jasmine": false, "jquery": false, "mocha": true, "mootools": false, "node": true, "nonstandard": false, "prototypejs": false, "qunit": false, "rhino": false, "shelljs": false, "worker": false, "wsh": false, "yui": false, "globals": {} }gcd-1.2.1/.npmignore000066400000000000000000000007621376063500300142570ustar00rootroot00000000000000 # Files # ######### Makefile README.md TODO.md # Directories # ############### build/ docs/ examples/ reports/ support/ test/ benchmark/ # Node.js # ########### .npmignore /node_modules/ # Logs # ######## *.log # OS generated files # ###################### .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes Icon? ehthumbs.db Thumbs.db Desktop.ini # Temporary files # ################### *~ # Git # ####### .git* # Utilities # ############# .jshintrc .jshintignore .travis.yml .editorconfig gcd-1.2.1/.travis.yml000066400000000000000000000002341376063500300143630ustar00rootroot00000000000000language: node_js node_js: - '0.12' - '0.11' - '0.10' - '0.8' - 'iojs' before_install: - npm update -g npm after_script: - npm run coveralls gcd-1.2.1/LICENSE000066400000000000000000000020751376063500300132640ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014-2015 Athan Reines. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gcd-1.2.1/Makefile000066400000000000000000000033661376063500300137230ustar00rootroot00000000000000 ############# # VARIABLES # # Set the node.js environment to test: NODE_ENV ?= test # NOTES # NOTES ?= 'TODO|FIXME|WARNING|HACK|NOTE' # MOCHA # MOCHA ?= ./node_modules/.bin/mocha _MOCHA ?= ./node_modules/.bin/_mocha MOCHA_REPORTER ?= spec # ISTANBUL # ISTANBUL ?= ./node_modules/.bin/istanbul ISTANBUL_OUT ?= ./reports/coverage ISTANBUL_REPORT ?= lcov ISTANBUL_LCOV_INFO_PATH ?= $(ISTANBUL_OUT)/lcov.info ISTANBUL_HTML_REPORT_PATH ?= $(ISTANBUL_OUT)/lcov-report/index.html # JSHINT # JSHINT ?= ./node_modules/.bin/jshint JSHINT_REPORTER ?= ./node_modules/jshint-stylish/stylish.js # FILES # # Source files: SOURCES ?= lib/*.js # Test files: TESTS ?= test/*.js ########### # TARGETS # # NOTES # .PHONY: notes notes: grep -Ern $(NOTES) $(SOURCES) $(TESTS) # UNIT TESTS # .PHONY: test test-mocha test: test-mocha test-mocha: node_modules NODE_ENV=$(NODE_ENV) \ NODE_PATH=$(NODE_PATH_TEST) \ $(MOCHA) \ --reporter $(MOCHA_REPORTER) \ $(TESTS) # CODE COVERAGE # .PHONY: test-cov test-istanbul-mocha test-cov: test-istanbul-mocha test-istanbul-mocha: node_modules NODE_ENV=$(NODE_ENV) \ NODE_PATH=$(NODE_PATH_TEST) \ $(ISTANBUL) cover \ --dir $(ISTANBUL_OUT) \ --report $(ISTANBUL_REPORT) \ $(_MOCHA) -- \ --reporter $(MOCHA_REPORTER) \ $(TESTS) # COVERAGE REPORT # .PHONY: view-cov view-istanbul-report view-cov: view-istanbul-report view-istanbul-report: open $(ISTANBUL_HTML_REPORT_PATH) # LINT # .PHONY: lint lint-jshint lint: lint-jshint lint-jshint: node_modules $(JSHINT) \ --reporter $(JSHINT_REPORTER) \ ./ # NODE # # Installing node_modules: .PHONY: install install: npm install # Clean node: .PHONY: clean-node clean-node: rm -rf node_modules # CLEAN # .PHONY: clean clean: rm -rf build gcd-1.2.1/README.md000066400000000000000000000073471376063500300135450ustar00rootroot00000000000000Greatest Common Divisor === [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url] > Computes the [greatest common divisor](http://en.wikipedia.org/wiki/Greatest_common_divisor) (gcd). Note: the gcd is also known as the __greatest common factor__ (gcf), __highest common factor__ (hcf), __highest common divisor__, and __greatest common measure__ (gcm). ## Installation ``` bash $ npm install compute-gcd ``` For use in the browser, use [browserify](https://github.com/substack/node-browserify). ## Usage ``` javascript var gcd = require( 'compute-gcd' ); ``` #### gcd( a, b[, c,...,n] ) Computes the [greatest common divisor](http://en.wikipedia.org/wiki/Greatest_common_divisor) (gcd) of two or more `integers`. ``` javascript var val = gcd( 48, 18 ); // returns 6 var val = gcd( 8, 12, 16 ); // returns 4 ``` #### gcd( arr[, accessor] ) Computes the [greatest common divisor](http://en.wikipedia.org/wiki/Greatest_common_divisor) (gcd) of two or more `integers`. ``` javascript var val = gcd( [48, 18] ); // returns 6 var val = gcd( [8, 12, 16] ); // returns 4 ``` For object `arrays`, provide an accessor `function` for accessing `array` values ``` javascript var data = [ ['beep', 4], ['boop', 8], ['bap', 12], ['baz', 16] ]; function getValue( d, i ) { return d[ 1 ]; } var arr = gcd( arr, getValue ); // returns 4 ``` ## Notes - For more than 3 values, a performance gain can be achieved if the values are sorted in ascending order. - If provided an `array` with a length less than `2` or a single `integer` argument, the function returns `null`. ## Examples ``` javascript var gcd = require( 'compute-gcd' ); // Compute the gcd of random tuples... var x, y, z, arr, val; for ( var i = 0; i < 100; i++ ) { x = Math.round( Math.random()*50 ); y = Math.round( Math.random()*50 ); z = Math.round( Math.random()*50 ); arr = [ x, y, z ]; val = gcd( arr ); console.log( arr, val ); } ``` To run the example code from the top-level application directory, ``` bash $ node ./examples/index.js ``` ## Tests ### Unit Unit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory: ``` bash $ make test ``` All new feature development should have corresponding unit tests to validate correct functionality. ### Test Coverage This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory: ``` bash $ make test-cov ``` Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report, ``` bash $ make view-cov ``` --- ## License [MIT license](http://opensource.org/licenses/MIT). ## Copyright Copyright © 2014-2015. Athan Reines. [npm-image]: http://img.shields.io/npm/v/compute-gcd.svg [npm-url]: https://npmjs.org/package/compute-gcd [travis-image]: http://img.shields.io/travis/compute-io/gcd/master.svg [travis-url]: https://travis-ci.org/compute-io/gcd [coveralls-image]: https://img.shields.io/coveralls/compute-io/gcd/master.svg [coveralls-url]: https://coveralls.io/r/compute-io/gcd?branch=master [dependencies-image]: http://img.shields.io/david/compute-io/gcd.svg [dependencies-url]: https://david-dm.org/compute-io/gcd [dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/gcd.svg [dev-dependencies-url]: https://david-dm.org/dev/compute-io/gcd [github-issues-image]: http://img.shields.io/github/issues/compute-io/gcd.svg [github-issues-url]: https://github.com/compute-io/gcd/issues gcd-1.2.1/TODO.md000066400000000000000000000000141376063500300133350ustar00rootroot00000000000000TODO ==== gcd-1.2.1/examples/000077500000000000000000000000001376063500300140715ustar00rootroot00000000000000gcd-1.2.1/examples/index.js000066400000000000000000000005031376063500300155340ustar00rootroot00000000000000'use strict'; var gcd = require( './../lib' ); // Compute the gcd of random tuples... var x, y, z, arr, val; for ( var i = 0; i < 100; i++ ) { x = Math.round( Math.random()*50 ); y = Math.round( Math.random()*50 ); z = Math.round( Math.random()*50 ); arr = [ x, y, z ]; val = gcd( arr ); console.log( arr, val ); } gcd-1.2.1/lib/000077500000000000000000000000001376063500300130215ustar00rootroot00000000000000gcd-1.2.1/lib/index.js000066400000000000000000000120011376063500300144600ustar00rootroot00000000000000'use strict'; // MODULES // var isArray = require( 'validate.io-array' ), isIntegerArray = require( 'validate.io-integer-array' ), isFunction = require( 'validate.io-function' ); // VARIABLES // var MAXINT = Math.pow( 2, 31 ) - 1; // FUNCTIONS // /** * FUNCTION: gcd( a, b ) * Computes the greatest common divisor of two integers `a` and `b`, using the binary GCD algorithm. * * @param {Number} a - integer * @param {Number} b - integer * @returns {Number} greatest common divisor */ function gcd( a, b ) { var k = 1, t; // Simple cases: if ( a === 0 ) { return b; } if ( b === 0 ) { return a; } // Reduce `a` and/or `b` to odd numbers and keep track of the greatest power of 2 dividing both `a` and `b`... while ( a%2 === 0 && b%2 === 0 ) { a = a / 2; // right shift b = b / 2; // right shift k = k * 2; // left shift } // Reduce `a` to an odd number... while ( a%2 === 0 ) { a = a / 2; // right shift } // Henceforth, `a` is always odd... while ( b ) { // Remove all factors of 2 in `b`, as they are not common... while ( b%2 === 0 ) { b = b / 2; // right shift } // `a` and `b` are both odd. Swap values such that `b` is the larger of the two values, and then set `b` to the difference (which is even)... if ( a > b ) { t = b; b = a; a = t; } b = b - a; // b=0 iff b=a } // Restore common factors of 2... return k * a; } // end FUNCTION gcd() /** * FUNCTION: bitwise( a, b ) * Computes the greatest common divisor of two integers `a` and `b`, using the binary GCD algorithm and bitwise operations. * * @param {Number} a - safe integer * @param {Number} b - safe integer * @returns {Number} greatest common divisor */ function bitwise( a, b ) { var k = 0, t; // Simple cases: if ( a === 0 ) { return b; } if ( b === 0 ) { return a; } // Reduce `a` and/or `b` to odd numbers and keep track of the greatest power of 2 dividing both `a` and `b`... while ( (a & 1) === 0 && (b & 1) === 0 ) { a >>>= 1; // right shift b >>>= 1; // right shift k++; } // Reduce `a` to an odd number... while ( (a & 1) === 0 ) { a >>>= 1; // right shift } // Henceforth, `a` is always odd... while ( b ) { // Remove all factors of 2 in `b`, as they are not common... while ( (b & 1) === 0 ) { b >>>= 1; // right shift } // `a` and `b` are both odd. Swap values such that `b` is the larger of the two values, and then set `b` to the difference (which is even)... if ( a > b ) { t = b; b = a; a = t; } b = b - a; // b=0 iff b=a } // Restore common factors of 2... return a << k; } // end FUNCTION bitwise() // GREATEST COMMON DIVISOR // /** * FUNCTION: compute( arr[, clbk] ) * Computes the greatest common divisor. * * @param {Number[]|Number} arr - input array of integers * @param {Function|Number} [clbk] - accessor function for accessing array values * @returns {Number|Null} greatest common divisor or null */ function compute() { var nargs = arguments.length, args, clbk, arr, len, a, b, i; // Copy the input arguments to an array... args = new Array( nargs ); for ( i = 0; i < nargs; i++ ) { args[ i ] = arguments[ i ]; } // Have we been provided with integer arguments? if ( isIntegerArray( args ) ) { if ( nargs === 2 ) { a = args[ 0 ]; b = args[ 1 ]; if ( a < 0 ) { a = -a; } if ( b < 0 ) { b = -b; } if ( a <= MAXINT && b <= MAXINT ) { return bitwise( a, b ); } else { return gcd( a, b ); } } arr = args; } // If not integers, ensure the first argument is an array... else if ( !isArray( args[ 0 ] ) ) { throw new TypeError( 'gcd()::invalid input argument. Must provide an array of integers. Value: `' + args[ 0 ] + '`.' ); } // Have we been provided with more than one argument? If so, ensure that the accessor argument is a function... else if ( nargs > 1 ) { arr = args[ 0 ]; clbk = args[ 1 ]; if ( !isFunction( clbk ) ) { throw new TypeError( 'gcd()::invalid input argument. Accessor must be a function. Value: `' + clbk + '`.' ); } } // We have been provided an array... else { arr = args[ 0 ]; } len = arr.length; // Check if a sufficient number of values have been provided... if ( len < 2 ) { return null; } // If an accessor is provided, extract the array values... if ( clbk ) { a = new Array( len ); for ( i = 0; i < len; i++ ) { a[ i ] = clbk( arr[ i ], i ); } arr = a; } // Given an input array, ensure all array values are integers... if ( nargs < 3 ) { if ( !isIntegerArray( arr ) ) { throw new TypeError( 'gcd()::invalid input argument. Accessed array values must be integers. Value: `' + arr + '`.' ); } } // Convert any negative integers to positive integers... for ( i = 0; i < len; i++ ) { a = arr[ i ]; if ( a < 0 ) { arr[ i ] = -a; } } // Exploit the fact that the gcd is an associative function... a = arr[ 0 ]; for ( i = 1; i < len; i++ ) { b = arr[ i ]; if ( b <= MAXINT && a <= MAXINT ) { a = bitwise( a, b ); } else { a = gcd( a, b ); } } return a; } // end FUNCTION compute() // EXPORTS // module.exports = compute; gcd-1.2.1/package-lock.json000066400000000000000000001340601376063500300154730ustar00rootroot00000000000000{ "name": "compute-gcd", "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", "dev": true }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" } }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, "requires": { "safer-buffer": "~2.1.0" } }, "assert-plus": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", "dev": true }, "assertion-error": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.0.tgz", "integrity": "sha1-x/hUOP3UZrx8oWq5DIFRN5el0js=", "dev": true }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, "aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", "dev": true }, "aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, "requires": { "tweetnacl": "^0.14.3" } }, "boom": { "version": "2.10.1", "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, "requires": { "hoek": "2.x.x" } }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "caseless": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", "dev": true }, "chai": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/chai/-/chai-2.3.0.tgz", "integrity": "sha1-ii9qNHSNqAEJD9cyh7Kqc5pOkJo=", "dev": true, "requires": { "assertion-error": "1.0.0", "deep-eql": "0.1.3" } }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", "has-ansi": "^2.0.0", "strip-ansi": "^3.0.0", "supports-color": "^2.0.0" } }, "cli": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", "dev": true, "requires": { "exit": "0.1.2", "glob": "^7.1.1" }, "dependencies": { "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } } } }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { "date-now": "^0.1.4" } }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "coveralls": { "version": "2.13.3", "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.3.tgz", "integrity": "sha512-iiAmn+l1XqRwNLXhW8Rs5qHZRFMYp9ZIPjEOVRpC/c4so6Y/f4/lFi0FfR5B9cCqgyhkJ5cZmbvcVRfP8MHchw==", "dev": true, "requires": { "js-yaml": "3.6.1", "lcov-parse": "0.0.10", "log-driver": "1.2.5", "minimist": "1.2.0", "request": "2.79.0" } }, "cryptiles": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "dev": true, "requires": { "boom": "2.x.x" } }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", "dev": true }, "debug": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", "dev": true, "requires": { "ms": "0.7.1" } }, "deep-eql": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", "dev": true, "requires": { "type-detect": "0.1.1" } }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, "diff": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", "dev": true }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "dev": true, "requires": { "domelementtype": "^2.0.1", "entities": "^2.0.0" }, "dependencies": { "domelementtype": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.2.tgz", "integrity": "sha512-wFwTwCVebUrMgGeAwRL/NhZtHAUyT9n9yg4IMDwf10+6iCMxSkVq9MGCVEH+QZWo1nNidy8kNvwmv4zWHDTqvA==", "dev": true }, "entities": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", "dev": true } } }, "domelementtype": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", "dev": true }, "domhandler": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", "dev": true, "requires": { "domelementtype": "1" } }, "domutils": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { "dom-serializer": "0", "domelementtype": "1" } }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, "entities": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", "dev": true }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "escodegen": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.7.1.tgz", "integrity": "sha1-MOz89mypjcZ80v0WKr626vqM5vw=", "dev": true, "requires": { "esprima": "^1.2.2", "estraverse": "^1.9.1", "esutils": "^2.0.2", "optionator": "^0.5.0", "source-map": "~0.2.0" }, "dependencies": { "esprima": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.5.tgz", "integrity": "sha1-CZNQL+r2aBODJXVvMPmlH+7sEek=", "dev": true } } }, "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", "dev": true }, "estraverse": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", "dev": true }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, "fast-levenshtein": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz", "integrity": "sha1-AXjc3uAjuSkFGTrwlZ6KdjnP3Lk=", "dev": true }, "fileset": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.2.1.tgz", "integrity": "sha1-WI74lzxmI7KnbfRlEFaWuWqsgGc=", "dev": true, "requires": { "glob": "5.x", "minimatch": "2.x" } }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "dev": true }, "form-data": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.5", "mime-types": "^2.1.12" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "generate-function": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", "dev": true, "requires": { "is-property": "^1.0.2" } }, "generate-object-property": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, "requires": { "is-property": "^1.0.0" } }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { "inflight": "^1.0.4", "inherits": "2", "minimatch": "2 || 3", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "growl": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", "dev": true }, "handlebars": { "version": "4.7.6", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "dev": true, "requires": { "minimist": "^1.2.5", "neo-async": "^2.6.0", "source-map": "^0.6.1", "uglify-js": "^3.1.4", "wordwrap": "^1.0.0" }, "dependencies": { "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "har-validator": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", "dev": true, "requires": { "chalk": "^1.1.1", "commander": "^2.9.0", "is-my-json-valid": "^2.12.4", "pinkie-promise": "^2.0.0" } }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, "hawk": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "dev": true, "requires": { "boom": "2.x.x", "cryptiles": "2.x.x", "hoek": "2.x.x", "sntp": "1.x.x" } }, "hoek": { "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", "dev": true }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "dev": true, "requires": { "domelementtype": "1", "domhandler": "2.3", "domutils": "1.5", "entities": "1.0", "readable-stream": "1.1" } }, "http-signature": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "dev": true, "requires": { "assert-plus": "^0.2.0", "jsprim": "^1.2.2", "sshpk": "^1.7.0" } }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "is-my-ip-valid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", "dev": true }, "is-my-json-valid": { "version": "2.20.5", "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.5.tgz", "integrity": "sha512-VTPuvvGQtxvCeghwspQu1rBgjYUT6FGxPlvFKbYuFtgc4ADsX3U5ihZOYN0qyU6u+d4X9xXb0IT5O6QpXKt87A==", "dev": true, "requires": { "generate-function": "^2.0.0", "generate-object-property": "^1.1.0", "is-my-ip-valid": "^1.0.0", "jsonpointer": "^4.0.0", "xtend": "^4.0.0" } }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", "dev": true }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, "istanbul": { "version": "0.3.22", "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.3.22.tgz", "integrity": "sha1-PhZNhQIf4ZyYXR8OfvDD4i0BLrY=", "dev": true, "requires": { "abbrev": "1.0.x", "async": "1.x", "escodegen": "1.7.x", "esprima": "2.5.x", "fileset": "0.2.x", "handlebars": "^4.0.1", "js-yaml": "3.x", "mkdirp": "0.5.x", "nopt": "3.x", "once": "1.x", "resolve": "1.1.x", "supports-color": "^3.1.0", "which": "^1.1.1", "wordwrap": "^1.0.0" }, "dependencies": { "esprima": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.5.0.tgz", "integrity": "sha1-84ekb9NEwbGjm6+MIL+0O20AWMw=", "dev": true }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { "has-flag": "^1.0.0" } } } }, "jade": { "version": "0.26.3", "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", "dev": true, "requires": { "commander": "0.6.1", "mkdirp": "0.3.0" }, "dependencies": { "commander": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", "dev": true }, "mkdirp": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", "dev": true } } }, "js-yaml": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^2.6.0" } }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, "jshint": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.12.0.tgz", "integrity": "sha512-TwuuaUDmra0JMkuqvqy+WGo2xGHSNjv1BA1nTIgtH2K5z1jHuAEeAgp7laaR+hLRmajRjcrM71+vByBDanCyYA==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", "lodash": "~4.17.19", "minimatch": "~3.0.2", "shelljs": "0.3.x", "strip-json-comments": "1.0.x" }, "dependencies": { "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } } } }, "jshint-stylish": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/jshint-stylish/-/jshint-stylish-1.0.2.tgz", "integrity": "sha1-6Z88w0CvsY4qdwL4eY10AMoxRGo=", "dev": true, "requires": { "chalk": "^1.0.0", "log-symbols": "^1.0.0", "string-length": "^1.0.0", "text-table": "^0.2.0" } }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, "jsonpointer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.1.0.tgz", "integrity": "sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg==", "dev": true }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", "json-schema": "0.2.3", "verror": "1.10.0" }, "dependencies": { "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "lcov-parse": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", "dev": true }, "levn": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz", "integrity": "sha1-uo0znQykphDjo/FFucr0iAcVUFQ=", "dev": true, "requires": { "prelude-ls": "~1.1.0", "type-check": "~0.3.1" } }, "lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "log-driver": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", "dev": true }, "log-symbols": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", "dev": true, "requires": { "chalk": "^1.0.0" } }, "lru-cache": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", "dev": true }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { "version": "2.1.27", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { "mime-db": "1.44.0" } }, "minimatch": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { "brace-expansion": "^1.0.0" } }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" }, "dependencies": { "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true } } }, "mocha": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.5.3.tgz", "integrity": "sha1-FhvlvetJZ3HrmzV0UFC2IrWu/Fg=", "dev": true, "requires": { "commander": "2.3.0", "debug": "2.2.0", "diff": "1.4.0", "escape-string-regexp": "1.0.2", "glob": "3.2.11", "growl": "1.9.2", "jade": "0.26.3", "mkdirp": "0.5.1", "supports-color": "1.2.0", "to-iso-string": "0.0.2" }, "dependencies": { "commander": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", "dev": true }, "escape-string-regexp": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", "dev": true }, "glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "dev": true, "requires": { "inherits": "2", "minimatch": "0.3" } }, "minimatch": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", "dev": true, "requires": { "lru-cache": "2", "sigmund": "~1.0.0" } }, "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" } }, "supports-color": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", "dev": true } } }, "ms": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", "dev": true }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { "abbrev": "1" } }, "oauth-sign": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" } }, "optionator": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.5.0.tgz", "integrity": "sha1-t1qJlaLUF98ltuTjhi9QqohlE2g=", "dev": true, "requires": { "deep-is": "~0.1.2", "fast-levenshtein": "~1.0.0", "levn": "~0.2.5", "prelude-ls": "~1.1.1", "type-check": "~0.3.1", "wordwrap": "~0.0.2" }, "dependencies": { "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", "dev": true } } }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "^2.0.0" } }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, "qs": { "version": "6.3.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", "dev": true }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "request": { "version": "2.79.0", "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", "dev": true, "requires": { "aws-sign2": "~0.6.0", "aws4": "^1.2.1", "caseless": "~0.11.0", "combined-stream": "~1.0.5", "extend": "~3.0.0", "forever-agent": "~0.6.1", "form-data": "~2.1.1", "har-validator": "~2.0.6", "hawk": "~3.1.3", "http-signature": "~1.1.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.7", "oauth-sign": "~0.8.1", "qs": "~6.3.0", "stringstream": "~0.0.4", "tough-cookie": "~2.3.0", "tunnel-agent": "~0.4.1", "uuid": "^3.0.0" } }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "shelljs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", "dev": true }, "sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", "dev": true }, "sntp": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "dev": true, "requires": { "hoek": "2.x.x" } }, "source-map": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", "dev": true, "optional": true, "requires": { "amdefine": ">=0.0.4" } }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", "bcrypt-pbkdf": "^1.0.0", "dashdash": "^1.12.0", "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", "jsbn": "~0.1.0", "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, "dependencies": { "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "string-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", "dev": true, "requires": { "strip-ansi": "^3.0.0" } }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, "stringstream": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", "dev": true }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", "dev": true }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, "to-iso-string": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/to-iso-string/-/to-iso-string-0.0.2.tgz", "integrity": "sha1-TcGeZk38y+Jb2NtQiwDG2hWCVdE=", "dev": true }, "tough-cookie": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { "punycode": "^1.4.1" } }, "tunnel-agent": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", "dev": true }, "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { "prelude-ls": "~1.1.2" } }, "type-detect": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", "dev": true }, "uglify-js": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.0.tgz", "integrity": "sha512-8lBMSkFZuAK7gGF8LswsXmir8eX8d2AAMOnxSDWjKBx/fBR6MypQjs78m6ML9zQVp1/hD4TBdfeMZMC7nW1TAA==", "dev": true, "optional": true }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "validate.io-array": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/validate.io-array/-/validate.io-array-1.0.6.tgz", "integrity": "sha1-W1osr9j4uFq7L4hroVPy2Tond00=" }, "validate.io-function": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/validate.io-function/-/validate.io-function-1.0.2.tgz", "integrity": "sha1-NDoZgC7TsZaCaceA5VjpNBHAutc=" }, "validate.io-integer": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/validate.io-integer/-/validate.io-integer-1.0.5.tgz", "integrity": "sha1-FoSWSAuVviJH7EQ/IjPeT4mHgGg=", "requires": { "validate.io-number": "^1.0.3" } }, "validate.io-integer-array": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/validate.io-integer-array/-/validate.io-integer-array-1.0.0.tgz", "integrity": "sha1-LKveAzKTpry+Bj/q/pHq9GsToIk=", "requires": { "validate.io-array": "^1.0.3", "validate.io-integer": "^1.0.4" } }, "validate.io-number": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/validate.io-number/-/validate.io-number-1.0.3.tgz", "integrity": "sha1-9j/+2iSL8opnqNSODjtGGhZluvg=" }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", "extsprintf": "^1.2.0" }, "dependencies": { "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" } }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true } } } gcd-1.2.1/package.json000066400000000000000000000034401376063500300145420ustar00rootroot00000000000000{ "name": "compute-gcd", "version": "1.2.1", "description": "Computes the greatest common divisor (gcd).", "author": { "name": "Athan Reines", "email": "kgryte@gmail.com" }, "contributors": [ { "name": "Athan Reines", "email": "kgryte@gmail.com" }, { "name": "Philipp Burckhardt", "email": "pburckhardt@outlook.com" } ], "scripts": { "test": "./node_modules/.bin/mocha", "test-cov": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec", "coveralls": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls" }, "main": "./lib", "repository": { "type": "git", "url": "git://github.com/compute-io/gcd.git" }, "keywords": [ "compute.io", "compute", "computation", "mathematics", "math", "euclid", "stein", "binary gcd", "greatest common divisor", "greatest common factor", "highest common factor", "greatest common measure", "highest common divisor", "gcd", "gcf", "hcf", "gcm", "arithmetic", "array", "integer" ], "bugs": { "url": "https://github.com/compute-io/gcd/issues" }, "dependencies": { "validate.io-array": "^1.0.3", "validate.io-function": "^1.0.2", "validate.io-integer-array": "^1.0.0" }, "devDependencies": { "chai": "2.x.x", "mocha": "2.x.x", "coveralls": "^2.11.1", "istanbul": "^0.3.0", "jshint": "2.x.x", "jshint-stylish": "^1.0.0" }, "licenses": [ { "type": "MIT", "url": "http://www.opensource.org/licenses/MIT" } ] } gcd-1.2.1/test/000077500000000000000000000000001376063500300132325ustar00rootroot00000000000000gcd-1.2.1/test/test.js000066400000000000000000000103321376063500300145460ustar00rootroot00000000000000/* global require, describe, it */ 'use strict'; // MODULES // var // Expectation library: chai = require( 'chai' ), // Module to be tested: gcd = require( './../lib' ); // VARIABLES // var expect = chai.expect, assert = chai.assert; // TESTS // describe( 'compute-gcd', function tests() { it( 'should export a function', function test() { expect( gcd ).to.be.a( 'function' ); }); it( 'should throw an error if not provided an integer array', function test() { var values = [ '5', null, undefined, NaN, {}, function(){}, [ Math.PI, 2 ], [ '1', 2 ], [ 1, Math.PI ], [ 1, '2' ], [ 1, NaN ], [ 1, null ] ]; for ( var i = 0; i < values.length; i++ ) { expect( badValue( values[i] ) ).to.throw( TypeError ); } function badValue( value ) { return function() { gcd( value ); }; } }); it( 'should throw an error if an accessed value is not an integer', function test() { expect( badValue ).to.throw( TypeError ); function badValue() { var arr = [ {'x':Math.PI}, {'x':5} ]; gcd( arr, getValue ); } function getValue( d ) { return d.x; } }); it( 'should throw an error if provided an accessor which is not a function', function test() { var values = [ '5', 5, true, undefined, null, NaN, [], {} ]; for ( var i = 0; i < values.length; i++ ) { expect( badValue( values[ i ] ) ).to.throw( TypeError ); } function badValue( value ) { return function() { gcd( [ 1, 2 ], value ); }; } }); it( 'should return null if only provided less than 2 integer arguments', function test() { assert.isNull( gcd( 5 ) ); }); it( 'should return null if provided a array having fewer than 2 elements', function test() { assert.isNull( gcd( [] ) ); assert.isNull( gcd( [ 1 ] ) ); }); it( 'should compute the gcd', function test() { var data; data = [ 0, 0 ]; assert.strictEqual( gcd( data ), 0 ); data = [ 1, 0 ]; assert.strictEqual( gcd( data ), 1 ); data = [ 0, 1 ]; assert.strictEqual( gcd( data ), 1 ); data = [ 6, 4 ]; assert.strictEqual( gcd( data ), 2 ); data = [ 6, -4 ]; assert.strictEqual( gcd( data ), 2 ); data = [ -6, -4 ]; assert.strictEqual( gcd( data ), 2 ); data = [ 15, 20 ]; assert.strictEqual( gcd( data ), 5 ); data = [ 20, 15 ]; assert.strictEqual( gcd( data ), 5 ); data = [ 35, -21 ]; assert.strictEqual( gcd( data ), 7 ); data = [ 48, 18 ]; assert.strictEqual( gcd( data ), 6 ); data = [ 8, 12, 16 ]; assert.strictEqual( gcd( data ), 4 ); data = [ 25, -35, 95 ]; assert.strictEqual( gcd( data ), 5 ); data = [ 95, -35, 25 ]; assert.strictEqual( gcd( data ), 5 ); data = [ 1500, 750, 150000, 625 ]; assert.strictEqual( gcd( data ), 125 ); }); it( 'should support an interface for providing two integers', function test() { assert.strictEqual( gcd( 48, 18 ), 6 ); assert.strictEqual( gcd( 35, -21 ), 7 ); assert.strictEqual( gcd( -6, -4 ), 2 ); assert.strictEqual( gcd( Math.pow( 2, 100 ), 3491832 ), 8 ); }); it( 'should provide a variadic interface', function test() { assert.strictEqual( gcd( 25, -35, 95 ), 5 ); }); it( 'should compute the gcd when values exceed the max safe (32-bit) integer', function test() { var data, a, b; a = Math.pow( 2, 100 ); b = Math.pow( 2, 53 ); data = [ a, 0 ]; assert.strictEqual( gcd( data ), a ); data = [ 0, b ]; assert.strictEqual( gcd( data ), b ); // Verified on Wolfram Alpha: data = [ a, b ]; assert.strictEqual( gcd( data ), 9007199254740992 ); // Verified on Wolfram Alpha: data = [ a, 73453 ]; assert.strictEqual( gcd( data ), 1 ); // Verified on Wolfram Alpha: data = [ a, 3491832 ]; assert.strictEqual( gcd( data ), 8 ); // Verified on Wolfram Alpha: data = [ 3491832, a ]; assert.strictEqual( gcd( data ), 8 ); }); it( 'should compute the gcd using an accessor function', function test() { var data; data = [ {'x':0}, {'x':0} ]; assert.strictEqual( gcd( data, getValue ), 0 ); data = [ {'x':1}, {'x':0} ]; assert.strictEqual( gcd( data, getValue ), 1 ); data = [ {'x':95}, {'x':-35}, {'x':25} ]; assert.strictEqual( gcd( data, getValue ), 5 ); function getValue( d ) { return d.x; } }); });