{"_id":"compute-dims","_rev":"8-486cfe84f63ab02aeb90f8869b993994","name":"compute-dims","description":"Computes array dimensions.","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0":{"name":"compute-dims","version":"0.0.0","description":"Computes array dimensions.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"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/dims.git"},"keywords":["compute.io","compute","computation","array","utilities","utils","dimensions","size","shape","dims"],"bugs":{"url":"https://github.com/compute-io/dims/issues"},"dependencies":{"validate.io-integer":"^1.0.2"},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"8072e54b12f8dd9a1499026867382953cdb9ac50","homepage":"https://github.com/compute-io/dims","_id":"compute-dims@0.0.0","_shasum":"5265ec9c71c0e02125eb9cedce49a40853f0c477","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"5265ec9c71c0e02125eb9cedce49a40853f0c477","tarball":"https://registry.npmjs.org/compute-dims/-/compute-dims-0.0.0.tgz","integrity":"sha512-PBxpj9zSKRx8BmufkEsj4xry3FRpS0BSgIPUXSJI3lMfIPjX6Dahk6giCANSys2mZVGvP8H2tVv7jU9lUwR1MA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwj1E4Kpz9d9CFASj3OZ4JijkLk3uMkTt6NjPaoOgcqgIgIFgBfbi4bDaaHNWvRB0ggroCH3OxChieKRw1QUBE3ZY="}]},"directories":{}},"1.0.0":{"name":"compute-dims","version":"1.0.0","description":"Computes array dimensions.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"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/dims.git"},"keywords":["compute.io","compute","computation","array","utilities","utils","dimensions","size","shape","dims"],"bugs":{"url":"https://github.com/compute-io/dims/issues"},"dependencies":{"validate.io-integer":"^1.0.2"},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"f0a3e14ce7df991e1725cc0d79454dacb9c16320","homepage":"https://github.com/compute-io/dims","_id":"compute-dims@1.0.0","_shasum":"977f73c272e5af63fbbf586b14d821c2292dcc27","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"977f73c272e5af63fbbf586b14d821c2292dcc27","tarball":"https://registry.npmjs.org/compute-dims/-/compute-dims-1.0.0.tgz","integrity":"sha512-UKmBEOiva+ZvXvGj4oldj5cohXNdHk2FzB/xer33XBW5ckg3A9EUqCRBUnaq9pZkWyr03C62uI1NTswGSCkdJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbzZhVwwYoQArEpUZExKOnMMOqU5IuGK6/vD86tMnmdAiA0rNvq850MpgFRCSsQPBVObRowlaGy2MN5owv+eZhapg=="}]},"directories":{}},"1.1.0":{"name":"compute-dims","version":"1.1.0","description":"Computes array dimensions.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"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/dims.git"},"keywords":["compute.io","compute","computation","array","utilities","utils","dimensions","size","shape","dims"],"bugs":{"url":"https://github.com/compute-io/dims/issues"},"dependencies":{"utils-copy":"^1.0.0","validate.io-array":"^1.0.6","validate.io-matrix-like":"^1.0.2","validate.io-ndarray-like":"^1.0.0","validate.io-positive-integer":"^1.0.0"},"devDependencies":{"chai":"3.x.x","coveralls":"^2.11.1","dstructs-matrix":"^2.0.0","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"7b3252a3e6daec743e48c5e1d25ebd229a31c42e","homepage":"https://github.com/compute-io/dims#readme","_id":"compute-dims@1.1.0","_npmVersion":"5.8.0","_nodeVersion":"8.9.1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"integrity":"sha512-YHMiIKjH/8Eom8zATk3g8/lH3HxGCZcVQyEfEoVrfWI7od/WRpTgRGShnei3jArYSx77mQqPxZNokjGHCdLfxg==","shasum":"6d5b712929b6c531af3b4d580ed5adacbbd77e0c","tarball":"https://registry.npmjs.org/compute-dims/-/compute-dims-1.1.0.tgz","fileCount":4,"unpackedSize":8350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb60SaCRA9TVsSAnZWagAAvNkP/RhprbQ8qO/3JVH2JCkS\nLArjGbhw+rvuZfWe2fMtU5+X/1uXSfkwgzaxxmUwYtce1B/9pcSJmvYfguJ+\nuV33jAeSPZ3uZSbte1+uEOouA4sBA21uMpiYJn1cjSkHKWPqqQcY0ncMrpRX\n+8vGyZpAJdfHeHLit9aFw1JFte3FhmH2aERFIARnWCX7AVfJTFtaO6oIbPqn\nwN80vwsRLJUQyhx/o1xftRr9z9Leuiq5TAI3S3TKMDGVbOj0chVbZwHZepc9\nkDBSxp/bM3cIoy4VLku83nQgpbai5fqsijNe61uB/wZGROFXIGrMrlgOu/I7\nho9V9OjQp82ouaaXYW6dxR/Wd8shbSkOHdJ2grDIlJvn0Isc1rQQMYxkLxNC\npIXsv8o6uTA8jYFK81wrCPNT3K0xXaTYsVuuHR87WnK0+oDmzi1c7yNZxnMc\nBjAQtw1DDArAXD1N3wC8l2hjp7QwnbPIPMn5ZXLEoY+3NB7fCpnnjbIL75i6\nT60L24FFs6wswTgj9uyWdQXrJqGapHdfzow2NELdBpndaYwbfnULg+hT17qm\n1dGdY97LWIoq/JFyAtpqGB2QibfNQP5RkIj3e+r7xdsnz1Ff4A3SajL4+EpS\nGudfnpWc+5CmX2NZTUlWnIDflgJV9Os5Js/uEhvsYhTtAljC2WCyZp5dpxjM\nmeAA\r\n=St8f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjRX1mIhz3+Q9h+W+AjBy3RpOMMfzkBXxYXioUJccRmQIhAO179y0mvXPaf0bOFfz3PiKa6V8kIIrYAtNKdwv0Qwjx"}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compute-dims_1.1.0_1542145177685_0.3491178973604636"},"_hasShrinkwrap":false}},"readme":"dims\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> Computes dimensions for arrays and matrices.\n\n\n## Installation\n\n``` bash\n$ npm install compute-dims\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n\n``` javascript\nvar dims = require( 'compute-dims' );\n```\n\n#### dims( x[, max] )\n\nComputes dimensions of `x`. `x` may be either an [`array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) (including nested `arrays`) or a [`matrix`](https://github.com/dstructs/matrix).\n\n``` javascript\nvar matrix = require( 'dstructs-matrix' ),\n\tdata,\n\td;\n\ndata = [ 1, 2 ];\nd = dims( data );\n// returns [2]\n\ndata = [ [1,2], [1,2] ];\nd = dims( data );\n// returns [2,2]\n\ndata = matrix( [1,2,3,4], [2,2] )\nd = dims( data );\n// returns [2,2]\n```\n\nIf an `array` element has a dimension inconsistent with other elements, the function returns `null`.\n\n``` javascript\ndata = [ [1,2], [1] ];\nd = dims( data );\n// returns null\n```\n\nTo limit the number of dimensions returned, set the `max` option.\n\n``` javascript\ndata = [ [[1,2], [3,4]] ]; // 1x2x2\nd = dims( data, 2 );\n// returns [1,2]\n\ndata = [ [[1,2], [3,4,5,6,7,8]] ];\nd = dims( data );\n// returns null\n\nd = dims( data, 2 );\n// returns [1,2]\n\ndata = matrix( [1,2,3,4], [2,2] );\nd = dims( data, 1 );\n// returns [2]\n```\n\n\n## Examples\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## Tests\n\n### Unit\n\nUnit 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:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis 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:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright &copy; 2014-2015. The [Compute.io](https://github.com/compute-io) Authors.\n\n[npm-image]: http://img.shields.io/npm/v/compute-dims.svg\n[npm-url]: https://npmjs.org/package/compute-dims\n\n[travis-image]: http://img.shields.io/travis/compute-io/dims/master.svg\n[travis-url]: https://travis-ci.org/compute-io/dims\n\n[coveralls-image]: https://img.shields.io/coveralls/compute-io/dims/master.svg\n[coveralls-url]: https://coveralls.io/r/compute-io/dims?branch=master\n\n[dependencies-image]: http://img.shields.io/david/compute-io/dims.svg\n[dependencies-url]: https://david-dm.org/compute-io/dims\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/dims.svg\n[dev-dependencies-url]: https://david-dm.org/dev/compute-io/dims\n\n[github-issues-image]: http://img.shields.io/github/issues/compute-io/dims.svg\n[github-issues-url]: https://github.com/compute-io/dims/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2022-06-13T20:27:40.302Z","created":"2014-11-22T19:29:07.259Z","0.0.0":"2014-11-22T19:29:07.259Z","1.0.0":"2014-11-22T19:29:21.659Z","1.1.0":"2018-11-13T21:39:37.818Z"},"homepage":"https://github.com/compute-io/dims#readme","keywords":["compute.io","compute","computation","array","utilities","utils","dimensions","size","shape","dims"],"repository":{"type":"git","url":"git://github.com/compute-io/dims.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/compute-io/dims/issues"},"readmeFilename":"README.md","license":"MIT"}