{"_id":"compute-dtype","_rev":"4-e407146ff1b712207c90ca8b36e4d1f5","name":"compute-dtype","description":"Determines the underlying data type of an input value.","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"compute-dtype","version":"0.0.0","description":"Determines the underlying data type of an input value.","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/dtype.git"},"keywords":["compute.io","compute","computation","dtype","data","type","ctor","constructor","typeof","array","object","util","utils","utility","utilities"],"bugs":{"url":"https://github.com/compute-io/dtype/issues"},"dependencies":{"compute-array-dtype":"^1.0.0","type-name":"^1.0.1"},"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"},"license":"MIT","gitHead":"b7b0672f1654b4d538fcd3095f27db2f59fe8055","homepage":"https://github.com/compute-io/dtype#readme","_id":"compute-dtype@0.0.0","_shasum":"71ef85229272e08d1711bdca0a74158844881e3d","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.10.29","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"71ef85229272e08d1711bdca0a74158844881e3d","tarball":"https://registry.npmjs.org/compute-dtype/-/compute-dtype-0.0.0.tgz","integrity":"sha512-ZzOjRbSVSXLFzFNYszcX0flSUOm8wxbXPwV38NosziU7kvaxsyev3EXsHdheuL3tlKVwh7BVqnHrEjpoNcSeGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBC4VlbAIed11m/bo1LZSpGSHMFjzcScTldQZUnTkF6LAiADTshQLfzvWFIkesgIPv9fis0WzEws9cvirZeIzrNa9Q=="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]},"1.0.0":{"name":"compute-dtype","version":"1.0.0","description":"Determines the underlying data type of an input value.","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/dtype.git"},"keywords":["compute.io","compute","computation","dtype","data","type","ctor","constructor","typeof","array","object","util","utils","utility","utilities"],"bugs":{"url":"https://github.com/compute-io/dtype/issues"},"dependencies":{"compute-array-dtype":"^1.0.0","type-name":"^1.0.1"},"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"},"license":"MIT","gitHead":"af98a900e592a5c6a3f4f1a3b37232b1a65c8f13","homepage":"https://github.com/compute-io/dtype#readme","_id":"compute-dtype@1.0.0","_shasum":"f7465fc268166e2b5a2b8a64b57cec69118d3574","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.10.29","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"f7465fc268166e2b5a2b8a64b57cec69118d3574","tarball":"https://registry.npmjs.org/compute-dtype/-/compute-dtype-1.0.0.tgz","integrity":"sha512-xrAGgGHxxnKjUhUasLZy/9uM8O6PeCZp5jsgTjHvdKiR5im4PwK/Bi+GRtn8kpGwgseh+g8QqGRmOMEAmh8jvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBrY6ZvDtSm7Y9GFZffLLwyd5lI1Bb3+MxeNWJ+sd9avAiEA+dVTztIPe8Jaet/f242zIjvZmV69MdE9njr/FgFjKBM="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]}},"readme":"dtype\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> Determines the underlying data type of an input value.\n\n\n## Installation\n\n``` bash\n$ npm install compute-dtype\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n``` javascript\nvar dtype = require( 'compute-dtype' );\n```\n\n#### dtype( value )\n\nDetermines the underlying data type of an input `value`.\n\n``` javascript\nvar dt = dtype( Int16Array( 10 ) );\n// returns 'int16'\n\ndt = dtype( true );\n// returns 'boolean'\n```\n\nThe following input values are supported:\n\n| Value | Data Type |\n|:------|:------------|\n| [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) | undefined |\n| [`null`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) | null |\n| [`true|false`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) | boolean |\n| [`<number>`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) | number |\n| [`<string>`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) | string |\n| [`<symbol>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) | symbol |\n| [`<function>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) | function |\n| [`Buffer`](https://nodejs.org/api/buffer.html) | binary |\n| [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) | binary |\n| [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) | int8 | \n| [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | uint8 | \n| [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) | uint8_clamped |\n| [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) | int16 |\n| [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) | uint16 |\n| [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) | int32 |\n| [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) | uint32 |\n| [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) | float32 |\n| [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) | float64 |\n| [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) | generic |\n| Other | generic |\n\n\n__Note__: values created using `String`, `Boolean`, and `Number` constructors are `Objects` and considered `generic`.\n\n\n\n\n## Examples\n\n``` javascript\nvar dtype = require( 'compute-dtype' );\n\nconsole.log( dtype( null ) );\n// returns 'null'\n\nconsole.log( dtype( undefined ) );\n// returns 'undefined'\n\nconsole.log( dtype( true ) );\n// returns 'boolean'\n\nconsole.log( dtype( Math.PI ) );\n// returns 'number'\n\nconsole.log( dtype( 'beep' ) );\n// returns 'string'\n\nconsole.log( dtype( function beep(){} ) );\n// returns 'function'\n\nconsole.log( dtype( new Int8Array( 10 ) ) );\n// returns 'int8'\n\nconsole.log( dtype( new Float64Array( 20 ) ) );\n// returns 'float64'\n\nconsole.log( dtype( new Buffer( 'woot' ) ) );\n// returns 'binary'\n\nconsole.log( dtype( [] ) );\n// returns 'generic'\n\nconsole.log( dtype( {} ) );\n// returns 'generic'\n\nconsole.log( dtype( new String( 'beep' ) ) );\n// returns 'generic'\n\nconsole.log( dtype( new Boolean( true ) ) );\n// returns 'generic'\n\nconsole.log( dtype( new Number( 5 ) ) );\n// returns 'generic'\n```\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; 2015. The Compute.io Authors.\n\n\n[npm-image]: http://img.shields.io/npm/v/compute-dtype.svg\n[npm-url]: https://npmjs.org/package/compute-dtype\n\n[travis-image]: http://img.shields.io/travis/compute-io/dtype/master.svg\n[travis-url]: https://travis-ci.org/compute-io/dtype\n\n[coveralls-image]: https://img.shields.io/coveralls/compute-io/dtype/master.svg\n[coveralls-url]: https://coveralls.io/r/compute-io/dtype?branch=master\n\n[dependencies-image]: http://img.shields.io/david/compute-io/dtype.svg\n[dependencies-url]: https://david-dm.org/compute-io/dtype\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/dtype.svg\n[dev-dependencies-url]: https://david-dm.org/dev/compute-io/dtype\n\n[github-issues-image]: http://img.shields.io/github/issues/compute-io/dtype.svg\n[github-issues-url]: https://github.com/compute-io/dtype/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"time":{"modified":"2022-06-13T20:27:50.307Z","created":"2015-06-03T04:51:36.753Z","0.0.0":"2015-06-03T04:51:36.753Z","1.0.0":"2015-06-03T04:51:55.668Z"},"homepage":"https://github.com/compute-io/dtype#readme","keywords":["compute.io","compute","computation","dtype","data","type","ctor","constructor","typeof","array","object","util","utils","utility","utilities"],"repository":{"type":"git","url":"git://github.com/compute-io/dtype.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/compute-io/dtype/issues"},"license":"MIT","readmeFilename":"README.md"}