{
  "name": "over",
  "description": "JavaScript function overloading framework.",
  "author": {
    "name": "Joe Ferner",
    "email": "joe@fernsroth.com"
  },
  "keywords": [
    "function",
    "overload"
  ],
  "version": "0.0.5",
  "bugs": {
    "url": "https://github.com/nearinfinity/node-over/issues"
  },
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/nearinfinity/node-over.git"
  },
  "main": "overload.js",
  "scripts": {
    "test": "nodeunit test"
  },
  "dependencies": {},
  "devDependencies": {
    "nodeunit": "~0.7.4"
  },
  "optionalDependencies": {},
  "engines": {
    "node": "*"
  },
  "readme": "# over\n\nJavaScript function overloading framework.\n\n## Installation\n\n```bash\n$ npm install over\n```\n\n## Quick Examples\n\n```javascript\nvar over = require('over');\n\nvar myfn = over([\n  [over.string, function (str) { console.log('got a string' + str); }],\n  [over.string, over.numberOptionalWithDefault(5), over.callbackOptional, function (str, number, callback) {\n    console.log('got a string and a number and a callback');\n    callback(str, number);\n  }],\n  function() {\n    // default function if nothing else matches\n  }\n]);\n```\n\n## Builtin Test functions\n\n* func\n* funcOptional\n* funcOptionalWithDefault\n* callbackOptional  // Will return an empty function of parameter is not given\n* string\n* stringOptional\n* stringOptionalWithDefault\n* number\n* numberOptional\n* numberOptionalWithDefault\n* array\n* arrayOptional\n* arrayOptionalWithDefault\n* object\n* objectOptional\n* objectOptionalWithDefault\n\nThe built in optional functions with a suffix of \"WithDefault\" take a default value as well which will be used if\nit is not passed in.\n\n```javascript\nvar myfn = over([\n  [over.stringOptionalWithDefault('default value'), function (str) { console.log('got a string' + str); }],\n]);\n```\n\n## Write your own test functions\n\nSimple optional test\n\n```javascript\nfunction greaterThan5Optional(arg) {\n  return arg > 5;\n}\ngreaterThan5Optional.optional = true; // mark it as an optional parameter\n\nvar myfn = over([\n  [greaterThan5Optional, function (v) { console.log('got a value' + v); }]\n]);\n```\n\nOptional test with default\n\n```javascript\nfunction greaterThan5OptionalWithDefault(def) {\n  return function greaterThan5OptionalWithDefault2(arg) {\n    if (arg === undefined) {\n      return { defaultValue: def };\n    }\n    return arg > 5;\n  }\n}\ngreaterThan5OptionalWithDefault.optional = true; // mark it as an optional parameter\n\nvar myfn = over([\n  [greaterThan5OptionalWithDefault, function (v) { console.log('got a value' + v); }]\n]);\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Near Infinity Corporation\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
  "readmeFilename": "README.md",
  "homepage": "https://github.com/nearinfinity/node-over",
  "_id": "over@0.0.5",
  "_shasum": "f29852e70fd7e25f360e013a8ec44c82aedb5708",
  "_from": "over@>= 0.0.5 < 1",
  "_resolved": "https://registry.npm.taobao.org/over/download/over-0.0.5.tgz"
}
