{"_id":"to-integer","_rev":"2906444","name":"to-integer","description":"Converts the given value to an integer. ","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"bubkoo","email":""}],"time":{"modified":"2022-12-14T07:21:25.000Z","created":"2016-04-13T02:55:54.510Z","1.0.1":"2016-04-15T05:31:38.542Z","1.0.0":"2016-04-13T10:10:54.506Z","0.0.0":"2016-04-13T02:55:54.510Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/gearcase/to-integer.git"},"versions":{"1.0.1":{"name":"to-integer","version":"1.0.1","description":"Converts the given value to an integer. ","main":"index.js","scripts":{"lint":"jshint index.js","pretest":"npm run lint","test":"mocha -R spec","test:cov":"rm -rf ./test/coverage && istanbul cover _mocha --dir ./test/coverage -- -R spec","test:rpt":"npm run test:cov && coveralls < ./test/coverage/lcov.info","prepublish":"npm test"},"keywords":["to","parse","convert","converter","parser","type","number","length","int","integer","float","decimal","binary","octal","hex","NaN","infinity"],"repository":{"type":"git","url":"git+https://github.com/gearcase/to-integer.git"},"license":"MIT","bugs":{"url":"https://github.com/gearcase/to-integer/issues"},"homepage":"https://github.com/gearcase/to-integer#readme","devDependencies":{"jshint":"^2.9.1","chai":"^3.5.0","coveralls":"^2.11.9","istanbul":"^0.4.2","mocha":"^2.4.5"},"dependencies":{"is-function":"^1.0.1","is-nil":"^1.0.0","is-object":"^1.0.1","is-symbol":"^1.0.1"},"gitHead":"0b84274519f33685d03de7c5f50b832119fcd860","_id":"to-integer@1.0.1","_shasum":"511ad41dce6a93730a8f3b6e35a164fd829464da","_from":".","_npmVersion":"3.8.5","_nodeVersion":"4.4.0","_npmUser":{"name":"bubkoo","email":"bubkoo.wy@gmail.com"},"dist":{"shasum":"511ad41dce6a93730a8f3b6e35a164fd829464da","size":2505,"noattachment":false,"key":"/to-integer/-/to-integer-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-integer/download/to-integer-1.0.1.tgz"},"maintainers":[{"name":"bubkoo","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/to-integer-1.0.1.tgz_1460698296450_0.8006454627029598"},"directories":{},"publish_time":1460698298542,"_hasShrinkwrap":false,"_cnpm_publish_time":1460698298542,"_cnpmcore_publish_time":"2021-12-16T21:12:38.154Z"},"1.0.0":{"name":"to-integer","version":"1.0.0","description":"Converts the given value to an integer. ","main":"index.js","scripts":{"lint":"jshint index.js","pretest":"npm run lint","test":"mocha -R spec","test:cov":"rm -rf ./test/coverage && istanbul cover _mocha --dir ./test/coverage -- -R spec","test:rpt":"npm run test:cov && coveralls < ./test/coverage/lcov.info","prepublish":"npm test"},"keywords":["to","parse","convert","converter","parser","type","number","length","int","integer","float","decimal","binary","octal","hex","NaN","infinity"],"repository":{"type":"git","url":"git+https://github.com/bubkoo/to-integer.git"},"license":"MIT","bugs":{"url":"https://github.com/bubkoo/to-integer/issues"},"homepage":"https://github.com/bubkoo/to-integer#readme","devDependencies":{"jshint":"^2.9.1","chai":"^3.5.0","coveralls":"^2.11.9","istanbul":"^0.4.2","mocha":"^2.4.5"},"dependencies":{"is-function":"^1.0.1","is-nil":"^1.0.0","is-object":"^1.0.1","is-symbol":"^1.0.1"},"gitHead":"108df6bb81491b2b465cd313c5207877219c50ef","_id":"to-integer@1.0.0","_shasum":"9d401a4f09a8f4f0e645f5e8d7ecafecc422f890","_from":".","_npmVersion":"3.8.5","_nodeVersion":"4.4.0","_npmUser":{"name":"bubkoo","email":"bubkoo.wy@gmail.com"},"dist":{"shasum":"9d401a4f09a8f4f0e645f5e8d7ecafecc422f890","size":2567,"noattachment":false,"key":"/to-integer/-/to-integer-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-integer/download/to-integer-1.0.0.tgz"},"maintainers":[{"name":"bubkoo","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/to-integer-1.0.0.tgz_1460542251589_0.6298024060670286"},"directories":{},"publish_time":1460542254506,"_hasShrinkwrap":false,"_cnpm_publish_time":1460542254506,"_cnpmcore_publish_time":"2021-12-16T21:12:38.505Z"},"0.0.0":{"name":"to-integer","version":"0.0.0","description":"Converts value to an integer.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/bubkoo/to-integer.git"},"author":{"name":"bubkoo","email":"bubkoo.wy@gmail.com","url":"https://github.com/bubkoo"},"license":"MIT","bugs":{"url":"https://github.com/bubkoo/to-integer/issues"},"homepage":"https://github.com/bubkoo/to-integer#readme","gitHead":"d081258f461795e42434538e38b30d5b475974a1","_id":"to-integer@0.0.0","_shasum":"60da24c3f861768b2d98806c2f3afd4ab68c62ca","_from":".","_npmVersion":"3.8.5","_nodeVersion":"4.4.0","_npmUser":{"name":"bubkoo","email":"bubkoo.wy@gmail.com"},"dist":{"shasum":"60da24c3f861768b2d98806c2f3afd4ab68c62ca","size":1087,"noattachment":false,"key":"/to-integer/-/to-integer-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-integer/download/to-integer-0.0.0.tgz"},"maintainers":[{"name":"bubkoo","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/to-integer-0.0.0.tgz_1460516151653_0.1660591613035649"},"directories":{},"publish_time":1460516154510,"_hasShrinkwrap":false,"_cnpm_publish_time":1460516154510,"_cnpmcore_publish_time":"2021-12-16T21:12:38.728Z"}},"readme":"# to-integer\n\n> Converts the given value to an integer. \n\n\n[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/gearcase/to-integer/blob/master/LICENSE)\n\n[![build:?](https://img.shields.io/travis/gearcase/to-integer/master.svg?style=flat-square)](https://travis-ci.org/gearcase/to-integer)\n[![coverage:?](https://img.shields.io/coveralls/gearcase/to-integer/master.svg?style=flat-square)](https://coveralls.io/github/gearcase/to-integer)\n\n\n## Install\n\n```\n$ npm install --save to-integer \n```\n\n\n## Usage\n\n> For more use-cases see the [tests](https://github.com/gearcase/to-integer/blob/master/test/spec/index.js)\n\n```js\nvar toInteger = require('to-integer');\n\ntoInteger(1);                // => 1\ntoInteger();                 // => 0\ntoInteger(null);             // => 0\ntoInteger(Number.MAX_VALUE); // => Number.MAX_VALUE\ntoInteger(Infinity);         // => Infinity\n\n// boolean\ntoInteger(true);  // => 1\ntoInteger(false); // => 0\n\n// string\ntoInteger('1');      // => 1\ntoInteger('0');      // => 0\ntoInteger('-1');     // => -1\ntoInteger('1.1000'); // => 1\ntoInteger('-1.100'); // => -1\ntoInteger('01');     // => 1\ntoInteger('0.10');   // => 0\ntoInteger('1a');     // => 1\ntoInteger('a1');     // => NaN\n\n// binary\ntoInteger('0b01'); // => 1\ntoInteger('0b10'); // => 2\ntoInteger('0b11'); // => 3\ntoInteger('0b02'); // => NaN\n\n// octal\ntoInteger('0o01'); // => 1 \ntoInteger('0o07'); // => 7\ntoInteger('0o10'); // => 8\ntoInteger('0o08'); // => NaN\n\n// hex\ntoInteger('0x01');  // => 1 \ntoInteger('0x0F');  // => 15 \ntoInteger('0x0G');  // => NaN\ntoInteger('-0x01'); // => NaN\ntoInteger('+0x01'); // => NaN\n\n// object\ntoInteger(new Object(1));   // => 1\ntoInteger(new Number(1));   // => 1\ntoInteger(new Number(1.1)); // => 1\ntoInteger(function () {});  // => NaN \ntoInteger(new Object());    // => NaN\n```\n\n## Related\n\n\n- [to-num](https://github.com/gearcase/to-num) - Converts the given value to a number.\n- [to-str](https://github.com/gearcase/to-str) - Converts the given value to a string.\n- [to-length](https://github.com/gearcase/to-length) - Converts value to an integer suitable for use as the length of an array-like object.\n- [to-lower](https://github.com/gearcase/to-lower) - Converts string, as a whole, to lower case.\n- [to-upper](https://github.com/gearcase/to-upper) - Converts string, as a whole, to upper case.\n- [to-path](https://github.com/gearcase/to-path) - Converts value to a property path array. \n- [to-source-code](https://github.com/gearcase/to-source-code.git) - Converts function to its source code.\n\n\n\n## Contributing\n\nPull requests and stars are highly welcome.\n\nFor bugs and feature requests, please [create an issue](https://github.com/gearcase/to-integer/issues/new).\n","_attachments":{},"homepage":"https://github.com/gearcase/to-integer#readme","bugs":{"url":"https://github.com/gearcase/to-integer/issues"},"license":"MIT"}