{
  "manifest": {
    "name": "normalize-range",
    "version": "0.1.2",
    "description": "Utility for normalizing a numeric range, with a wrapping function useful for polar coordinates",
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/jamestalmage/normalize-range.git"
    },
    "author": {
      "name": "James Talmage",
      "email": "james@talmage.io",
      "url": "github.com/jamestalmage"
    },
    "engines": {
      "node": ">=0.10.0"
    },
    "scripts": {
      "test": "npm run cover && npm run lint && npm run style",
      "cover": "istanbul cover ./node_modules/.bin/_mocha",
      "lint": "jshint --reporter=node_modules/jshint-stylish *.js test/*.js",
      "debug": "mocha",
      "watch": "mocha -w",
      "style": "jscs *.js ./**/*.js && jscs ./test/** --config=./test/.jscsrc"
    },
    "files": [
      "index.js"
    ],
    "keywords": [
      "range",
      "normalize",
      "utility",
      "angle",
      "degrees",
      "polar"
    ],
    "dependencies": {},
    "devDependencies": {
      "almost-equal": "^1.0.0",
      "codeclimate-test-reporter": "^0.1.0",
      "coveralls": "^2.11.2",
      "istanbul": "^0.3.17",
      "jscs": "^2.1.1",
      "jshint": "^2.8.0",
      "jshint-stylish": "^2.0.1",
      "mocha": "^2.2.5",
      "stringify-pi": "0.0.3"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-normalize-range-0.1.2-2d10c06bdfd312ea9777695a4d28439456b75942-integrity/node_modules/normalize-range/package.json",
    "readmeFilename": "readme.md",
    "readme": "# normalize-range \n\nUtility for normalizing a numeric range, with a wrapping function useful for polar coordinates.\n\n[![Build Status](https://travis-ci.org/jamestalmage/normalize-range.svg?branch=master)](https://travis-ci.org/jamestalmage/normalize-range)\n[![Coverage Status](https://coveralls.io/repos/jamestalmage/normalize-range/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/normalize-range?branch=master)\n[![Code Climate](https://codeclimate.com/github/jamestalmage/normalize-range/badges/gpa.svg)](https://codeclimate.com/github/jamestalmage/normalize-range)\n[![Dependency Status](https://david-dm.org/jamestalmage/normalize-range.svg)](https://david-dm.org/jamestalmage/normalize-range)\n[![devDependency Status](https://david-dm.org/jamestalmage/normalize-range/dev-status.svg)](https://david-dm.org/jamestalmage/normalize-range#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/normalize-range.png)](https://nodei.co/npm/normalize-range/)\n\n## Usage\n\n```js\nvar nr = require('normalize-range');\n\nnr.wrap(0, 360, 400);\n//=> 40\n\nnr.wrap(0, 360, -90);\n//=> 270\n\nnr.limit(0, 100, 500);\n//=> 100\n\nnr.limit(0, 100, -20);\n//=> 0\n\n// There is a convenient currying function\nvar wrapAngle = nr.curry(0, 360).wrap;\nvar limitTo10 = nr.curry(0, 10).limit;\n\nwrapAngle(-30);\n//=> 330\n```\n## API\n\n### wrap(min, max, value)\n\nNormalizes a values that \"wraps around\". For example, in a polar coordinate system, 270˚ can also be\nrepresented as -90˚. \nFor wrapping purposes we assume `max` is functionally equivalent to `min`, and that `wrap(max + 1) === wrap(min + 1)`.\nWrap always assumes that `min` is *inclusive*, and `max` is *exclusive*.\nIn other words, if `value === max` the function will wrap it, and return `min`, but `min` will not be wrapped.\n\n```js\nnr.wrap(0, 360, 0) === 0;\nnr.wrap(0, 360, 360) === 0;\nnr.wrap(0, 360, 361) === 1;\nnr.wrap(0, 360, -1) === 359;\n```\n\nYou are not restricted to whole numbers, and ranges can be negative.\n\n```js\nvar π = Math.PI;\nvar radianRange = nr.curry(-π, π);\n\nredianRange.wrap(0) === 0;\nnr.wrap(π) === -π;\nnr.wrap(4 * π / 3) === -2 * π / 3;\n```\n\n### limit(min, max, value)\n\nNormalize the value by bringing it within the range.\nIf `value` is greater than `max`, `max` will be returned.\nIf `value` is less than `min`, `min` will be returned.\nOtherwise, `value` is returned unaltered.\nBoth ends of this range are *inclusive*.\n\n### test(min, max, value, [minExclusive], [maxExclusive])\n\nReturns `true` if `value` is within the range, `false` otherwise.\nIt defaults to `inclusive` on both ends of the range, but that can be\nchanged by setting `minExclusive` and/or `maxExclusive` to a truthy value.\n\n### validate(min, max, value, [minExclusive], [maxExclusive])\n\nReturns `value` or throws an error if `value` is outside the specified range.\n\n### name(min, max, value, [minExclusive], [maxExclusive])\n\nReturns a string representing this range in \n[range notation](https://en.wikipedia.org/wiki/Interval_(mathematics)#Classification_of_intervals).\n\n### curry(min, max, [minExclusive], [maxExclusive])\n\nConvenience method for currying all method arguments except `value`.\n\n```js\nvar angle = require('normalize-range').curry(-180, 180, false, true);\n\nangle.wrap(270)\n//=> -90\n\nangle.limit(200)\n//=> 180\n\nangle.test(0)\n//=> true\n\nangle.validate(300)\n//=> throws an Error\n\nangle.toString() // or angle.name()\n//=> \"[-180,180)\"\n```\n\n#### min\n\n*Required*  \nType: `number`\n\nThe minimum value (inclusive) of the range.\n\n#### max\n\n*Required*  \nType: `number`\n\nThe maximum value (exclusive) of the range.\n\n#### value\n\n*Required*  \nType: `number`\n\nThe value to be normalized.\n\n#### returns\n\nType: `number`\n\nThe normalized value.\n\n## Building and Releasing\n\n- `npm test`: tests, linting, coverage and style checks.\n- `npm run watch`: autotest mode for active development.\n- `npm run debug`: run tests without coverage (istanbul can obscure line #'s) \n\nRelease via `cut-release` tool.\n\n## License\n\nMIT © [James Talmage](http://github.com/jamestalmage)\n",
    "licenseText": "The MIT License (MIT)\n\nCopyright (c) James Talmage <james@talmage.io> (github.com/jamestalmage)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz",
    "hash": "2d10c06bdfd312ea9777695a4d28439456b75942",
    "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==",
    "registry": "npm",
    "packageName": "normalize-range",
    "cacheIntegrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== sha1-LRDAa9/TEuqXd2laTShDlFa3WUI="
  },
  "registry": "npm",
  "hash": "2d10c06bdfd312ea9777695a4d28439456b75942"
}