{"name":"to-primitive-x","version":"1.0.0","description":"Converts a JavaScript object to a primitive value.","homepage":"https://github.com/Xotic750/to-primitive-x","author":{"name":"Graham Fairweather","email":"xotic750@gmail.com"},"copyright":"Copyright (c) 2017","keywords":["toPrimitive","module","javascript","nodejs","browser"],"main":"index.js","engines":{"node":"*"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Xotic750/to-primitive-x.git"},"bugs":{"url":"https://github.com/Xotic750/to-primitive-x/issues"},"dependencies":{"has-symbol-support-x":"^1.4.0","is-date-object":"^1.0.1","is-function-x":"^3.1.0","is-nil-x":"^1.4.0","is-primitive":"^2.0.0","is-symbol":"^1.0.1","require-object-coercible-x":"^1.4.0"},"devDependencies":{"@xotic750/eslint-config-standard-x":"^2.2.1","browserify":"^14.4.0","browserify-derequire":"^0.9.4","cross-env":"^5.0.1","es5-shim":"^4.5.9","es6-shim":"^0.35.3","es7-shim":"^6.0.0","eslint":"^4.2.0","eslint-plugin-compat":"^1.0.4","eslint-plugin-css-modules":"^2.7.2","eslint-plugin-eslint-comments":"^1.0.2","eslint-plugin-jsdoc":"^3.1.1","eslint-plugin-json":"^1.2.0","eslint-plugin-no-use-extend-native":"^0.3.12","husky":"^0.13.4","jasmine-node":"^1.14.5","jsdoc-to-markdown":"^3.0.0","json3":"^3.3.2","make-jasmine-spec-runner-html":"^1.3.0","ncp":"^2.0.0","nodemon":"^1.11.0","nsp":"^2.6.3","parallelshell":"^3.0.1","replace-x":"^1.5.0","rimraf":"^2.6.1","serve":"^6.0.2","uglify-js":"^3.0.24"},"scripts":{"clean":"rimraf README.md lib/*","clean:jasmine":"rimraf tests/index.html tests/run.js","clean:all":"npm run clean:jasmine && npm run clean","build":"npm run clean && npm run lint && npm run browserify && npm run uglify && npm run docs && npm test && npm run security","build:jasmine":"npm run clean:jasmine && make-jasmine-spec-runner-html","build:setver":"replace-x \" @version .*\" \" @version $(node -p -e \"require('./package.json').version\")\" index.js","build:name":"replace-x \" @module .*\" \" @module $(node -p -e \"require('./package.json').name\")\" index.js","build:description":"replace-x \" @file .*\" \" @file $(node -p -e \"require('./package.json').description\")\" index.js","build:replace":"npm run build:setver && npm run build:name && npm run build:description","production":"npm run clean:all && npm run build:jasmine && npm run build:replace && npm run build","start":"parallelshell \"serve\" \"nodemon --watch index.js --exec 'npm run build'\"","docs:name":"replace-x \"@{PACKAGE-NAME}\" \"$(node -p -e \"require('./package.json').name\")\" README.md","docs:badges":"ncp badges.html README.md && npm run docs:name","docs":"npm run docs:badges && jsdoc2md --name-format --example-lang js index.js >> README.md","lint":"eslint *.js tests/spec/*.js","lint-fix":"npm run lint -- --fix","security":"nsp check","test":"jasmine-node --matchall tests/spec/","browserify":"browserify -p browserify-derequire -e index.js -o lib/to-primitive-x.js -u 'crypto' -s returnExports","uglify":"uglifyjs lib/to-primitive-x.js -o lib/to-primitive-x.min.js --config-file .uglifyjsrc.json","precommit":"npm run production","prepush":"npm run production"},"gitHead":"40a3b1d111ebef8c5bad5348a38da9122aadf556","_id":"to-primitive-x@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"6.11.2","_npmUser":{"name":"xotic750","email":"xotic750@gmail.com"},"dist":{"integrity":"sha512-wnjhKvflpyyYoH7/F10qakQuO3CgsMWoMJWzPXXm4TIGlXhO+k/zeMGgUe74b8ac+SDHbf+53Ig/0NmtZMoxJg==","shasum":"a7b395faa7749d7dabe5f1aaf4b20ffab736961c","tarball":"http://registry-npm.ywwl.com/to-primitive-x/download/to-primitive-x-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDksid36em2AoooCQ5R0Gdvapk6jNjrELRB48ZUk7bXRAIhANEbnPYw1ULxNl22N49Ksmu02LkUq7K2PtGn3fwCsOtw"}],"size":18012,"noattachment":false,"key":"/to-primitive-x/-/to-primitive-x-1.0.0.tgz"},"maintainers":[{"name":"xotic750","email":"xotic750@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/to-primitive-x-1.0.0.tgz_1503932877360_0.06595321069471538"},"directories":{},"readme":"<a\n  href=\"https://travis-ci.org/Xotic750/to-primitive-x\"\n  title=\"Travis status\">\n<img\n  src=\"https://travis-ci.org/Xotic750/to-primitive-x.svg?branch=master\"\n  alt=\"Travis status\" height=\"18\">\n</a>\n<a\n  href=\"https://david-dm.org/Xotic750/to-primitive-x\"\n  title=\"Dependency status\">\n<img src=\"https://david-dm.org/Xotic750/to-primitive-x/status.svg\"\n  alt=\"Dependency status\" height=\"18\"/>\n</a>\n<a\n  href=\"https://david-dm.org/Xotic750/to-primitive-x?type=dev\"\n  title=\"devDependency status\">\n<img src=\"https://david-dm.org/Xotic750/to-primitive-x/dev-status.svg\"\n  alt=\"devDependency status\" height=\"18\"/>\n</a>\n<a\n  href=\"https://badge.fury.io/js/to-primitive-x\"\n  title=\"npm version\">\n<img src=\"https://badge.fury.io/js/to-primitive-x.svg\"\n  alt=\"npm version\" height=\"18\">\n</a>\n<a\n  href=\"https://www.jsdelivr.com/package/npm/to-primitive-x\"\n  title=\"jsDelivr hits\">\n<img src=\"https://data.jsdelivr.com/v1/package/npm/to-primitive-x/badge?style=rounded\"\n  alt=\"jsDelivr hits\" height=\"18\">\n</a>\n<a\n  href=\"https://bettercodehub.com/results/Xotic750/to-primitive-x\"\n  title=\"bettercodehub score\">\n<img src=\"https://bettercodehub.com/edge/badge/Xotic750/to-primitive-x?branch=master\"\n  alt=\"bettercodehub score\" height=\"18\">\n</a>\n<a\n  href=\"https://coveralls.io/github/Xotic750/to-primitive-x?branch=master\"\n  title=\"Coverage Status\">\n<img src=\"https://coveralls.io/repos/github/Xotic750/to-primitive-x/badge.svg?branch=master\"\n  alt=\"Coverage Status\" height=\"18\">\n</a>\n\n<a name=\"module_to-primitive-x\"></a>\n\n## to-primitive-x\n\nConverts a JavaScript object to a primitive value.\n\n<a name=\"exp_module_to-primitive-x--module.exports\"></a>\n\n### `module.exports(input, [prefferedtype])` ⇒ <code>string</code> \\| <code>number</code> ⏏\n\nThis method converts a JavaScript object to a primitive value.\nNote: When toPrimitive is called with no hint, then it generally behaves as\nif the hint were Number. However, objects may over-ride this behaviour by\ndefining a @@toPrimitive method. Of the objects defined in this specification\nonly Date objects (see 20.3.4.45) and Symbol objects (see 19.4.3.4) over-ride\nthe default ToPrimitive behaviour. Date objects treat no hint as if the hint\nwere String.\n\n**Kind**: Exported function  \n**Returns**: <code>string</code> \\| <code>number</code> - The converted input as a primitive.  \n**Throws**:\n\n- <code>TypeError</code> If unable to convert input to a primitive.\n\n| Param           | Type                     | Description                            |\n| --------------- | ------------------------ | -------------------------------------- |\n| input           | <code>\\*</code>          | The input to convert.                  |\n| [prefferedtype] | <code>constructor</code> | The preffered type (String or Number). |\n\n**Example**\n\n```js\nimport toPrimitive from 'to-primitive-x';\n\nconst date = new Date(0);\nconsole.log(toPrimitive(date)); // Thu Jan 01 1970 01:00:00 GMT+0100 (CET)\nconsole.log(toPrimitive(date, String)); // Thu Jan 01 1970 01:00:00 GMT+0100 (CET)\nconsole.log(toPrimitive(date, Number)); // 0\n```\n","publish_time":1503932878669,"_cnpm_publish_time":1503932878669,"dist-tags":{"latest":"2.1.2"}}