{"_id":"reduce-function-call","_rev":"81537","name":"reduce-function-call","description":"Reduce function calls in a string, using a callback","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"moox","email":""},{"name":"npm:moox","email":""}],"time":{"modified":"2023-03-27T17:09:46.000Z","created":"2014-08-06T05:19:25.510Z","1.0.3":"2019-09-12T05:35:24.165Z","1.0.2":"2016-11-28T07:23:06.276Z","1.0.1":"2014-08-06T07:00:48.107Z","1.0.0":"2014-08-06T05:19:25.510Z"},"users":{},"author":{"name":"MoOx"},"repository":{"type":"git","url":"git+https://github.com/MoOx/reduce-function-call.git"},"versions":{"1.0.3":{"name":"reduce-function-call","version":"1.0.3","description":"Reduce function calls in a string, using a callback","keywords":["string","reduce","replacement","function","call","eval","interpret"],"author":{"name":"MoOx"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/MoOx/reduce-function-call.git"},"dependencies":{"balanced-match":"^1.0.0"},"devDependencies":{"npmpub":"^4.1.0","tape":"^4.0.3"},"scripts":{"test":"tape test","release":"npmpub"},"gitHead":"c03d492117d90398d4deb8af207928a00921f6aa","bugs":{"url":"https://github.com/MoOx/reduce-function-call/issues"},"homepage":"https://github.com/MoOx/reduce-function-call#readme","_id":"reduce-function-call@1.0.3","_nodeVersion":"10.15.1","_npmVersion":"6.9.0","dist":{"shasum":"60350f7fb252c0a67eb10fd4694d16909971300f","size":2859,"noattachment":false,"key":"/reduce-function-call/-/reduce-function-call-1.0.3.tgz","tarball":"http://name.csiicloud.com:7001/reduce-function-call/download/reduce-function-call-1.0.3.tgz"},"maintainers":[{"name":"moox","email":""},{"name":"npm:moox","email":""}],"_npmUser":{"name":"moox","email":"npm@moox.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce-function-call_1.0.3_1568266524023_0.9800908344236074"},"_hasShrinkwrap":false,"publish_time":1568266524165,"_cnpm_publish_time":1568266524165},"1.0.2":{"name":"reduce-function-call","version":"1.0.2","description":"Reduce function calls in a string, using a callback","keywords":["string","reduce","replacement","function","call","eval","interpret"],"author":{"name":"MoOx"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/MoOx/reduce-function-call.git"},"files":["CHANGELOG.md","LICENSE","README.md","index.js"],"dependencies":{"balanced-match":"^0.4.2"},"devDependencies":{"jscs":"^2.0.0","jshint":"^2.8.0","jshint-stylish":"^2.0.1","npmpub":"^3.1.0","tap-colorize":"^1.2.0","tape":"^4.0.3"},"scripts":{"jscs":"jscs *.js **/*.js","jshint":"jshint . --exclude node_modules --reporter node_modules/jshint-stylish/index.js","test":"npm run jscs && npm run jshint && tape test | tap-colorize","release":"npmpub"},"gitHead":"0e5721cbbef019419abb593dce4862794cad4872","bugs":{"url":"https://github.com/MoOx/reduce-function-call/issues"},"homepage":"https://github.com/MoOx/reduce-function-call#readme","_id":"reduce-function-call@1.0.2","_shasum":"5a200bf92e0e37751752fe45b0ab330fd4b6be99","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"moox","email":"m@moox.io"},"dist":{"shasum":"5a200bf92e0e37751752fe45b0ab330fd4b6be99","size":2780,"noattachment":false,"key":"/reduce-function-call/-/reduce-function-call-1.0.2.tgz","tarball":"http://name.csiicloud.com:7001/reduce-function-call/download/reduce-function-call-1.0.2.tgz"},"maintainers":[{"name":"moox","email":""},{"name":"npm:moox","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/reduce-function-call-1.0.2.tgz_1480317784283_0.19223617459647357"},"directories":{},"publish_time":1480317786276,"_cnpm_publish_time":1480317786276,"_hasShrinkwrap":false},"1.0.1":{"name":"reduce-function-call","version":"1.0.1","description":"Reduce function calls in a string, using a callback","keywords":["string","reduce","replacement","function","call","eval","interpret"],"author":{"name":"MoOx"},"license":"MIT","repository":{"type":"git","url":"https://github.com/MoOx/reduce-function-call.git"},"files":["CHANGELOG.md","LICENSE","README.md","index.js"],"dependencies":{"balanced-match":"~0.1.0"},"devDependencies":{"jscs":"^1.5.9","jshint":"^2.5.2","jshint-stylish":"^0.4.0","tap-colorize":"^1.2.0","tape":"^2.13.4"},"scripts":{"jscs":"jscs *.js **/*.js","jshint":"jshint . --exclude node_modules --reporter node_modules/jshint-stylish/stylish.js","test":"npm run jscs && npm run jshint && tape test | tap-colorize"},"gitHead":"eae61552a3ad386e221cb0315b6ac755393c5183","bugs":{"url":"https://github.com/MoOx/reduce-function-call/issues"},"homepage":"https://github.com/MoOx/reduce-function-call","_id":"reduce-function-call@1.0.1","_shasum":"fa02e126e695824263cab91d3a5b0fdc1dd27a9a","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"moox","email":"m@moox.io"},"maintainers":[{"name":"moox","email":""},{"name":"npm:moox","email":""}],"dist":{"shasum":"fa02e126e695824263cab91d3a5b0fdc1dd27a9a","size":2660,"noattachment":false,"key":"/reduce-function-call/-/reduce-function-call-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/reduce-function-call/download/reduce-function-call-1.0.1.tgz"},"directories":{},"publish_time":1407308448107,"_cnpm_publish_time":1407308448107,"_hasShrinkwrap":false},"1.0.0":{"name":"reduce-function-call","version":"1.0.0","description":"Reduce function calls in a string, using a callback","keywords":["string","reduce","replacement","function","call","eval","interpret"],"author":{"name":"MoOx"},"license":"MIT","repository":{"type":"git","url":"https://github.com/MoOx/reduce-function-call.git"},"files":["CHANGELOG.md","LICENSE","README.md","index.js"],"dependencies":{"balanced-match":"~0.1.0"},"devDependencies":{"jscs":"^1.5.9","jshint":"^2.5.2","jshint-stylish":"^0.4.0","tap-colorize":"^1.2.0","tape":"^2.13.4"},"scripts":{"jscs":"jscs *.js **/*.js","jshint":"jshint . --exclude node_modules --reporter node_modules/jshint-stylish/stylish.js","test":"npm run jscs && npm run jshint && tape test | tap-colorize"},"gitHead":"395cae7c72d76dddf4e8573d4e6c4fd25dfc1c4a","bugs":{"url":"https://github.com/MoOx/reduce-function-call/issues"},"homepage":"https://github.com/MoOx/reduce-function-call","_id":"reduce-function-call@1.0.0","_shasum":"ea2af804322728dbaccbafd0c2d5aed91f5be497","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"moox","email":"m@moox.io"},"maintainers":[{"name":"moox","email":""},{"name":"npm:moox","email":""}],"dist":{"shasum":"ea2af804322728dbaccbafd0c2d5aed91f5be497","size":2652,"noattachment":false,"key":"/reduce-function-call/-/reduce-function-call-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/reduce-function-call/download/reduce-function-call-1.0.0.tgz"},"directories":{},"publish_time":1407302365510,"_cnpm_publish_time":1407302365510,"_hasShrinkwrap":false}},"readme":"# reduce-function-call [![Build Status](https://travis-ci.org/MoOx/reduce-function-call.svg?branch=master)](https://travis-ci.org/MoOx/reduce-function-call)\n\n> Reduce function calls in a string, using a callback\n\n---\n\n[Professionally supported reduce-function-call is now available](https://tidelift.com/subscription/pkg/npm-reduce-function-call?utm_source=npm-reduce-function-call&utm_medium=referral&utm_campaign=readme)\n\n---\n\n## Installation\n\n```console\nnpm install reduce-function-call\n```\n\n## Usage\n\n```js\nvar reduceFunctionCall = require(\"reduce-function-call\")\n\nreduceFunctionCall(\"foo(1)\", \"foo\", function(body) {\n  // body === \"1\"\n  return parseInt(body, 10) + 1\n})\n// \"2\"\n\nvar nothingOrUpper = function(body, functionIdentifier) {\n  // ignore empty value\n  if (body === \"\") {\n    return functionIdentifier + \"()\"\n  }\n\n  return body.toUpperCase()\n}\n\nreduceFunctionCall(\"bar()\", \"bar\", nothingOrUpper)\n// \"bar()\"\n\nreduceFunctionCall(\"upper(baz)\", \"upper\", nothingOrUpper)\n// \"BAZ\"\n\nreduceFunctionCall(\"math(math(2 + 2) * 4 + math(2 + 2)) and other things\", \"math\", function(body, functionIdentifier, call) {\n  try {\n    return eval(body)\n  }\n  catch (e) {\n    return call\n  }\n})\n// \"20 and other things\"\n\nreduceFunctionCall(\"sha bla blah() blaa bla() abla() aabla() blaaa()\", /\\b([a-z]?bla[a-z]?)\\(/, function(body, functionIdentifier) {\n  if (functionIdentifier === \"bla\") {\n    return \"ABRACADABRA\"\n  }\n  return functionIdentifier.replace(\"bla\", \"!\")\n}\n// \"sha bla !h blaa ABRACADABRA a! aabla() blaaa()\"\n```\n\nSee [unit tests](test/index.js) for others examples.\n\n## Contributing\n\nWork on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.\n\n```console\ngit clone https://github.com/MoOx/reduce-function-call.git\ngit checkout -b patch-1\nnpm install\nnpm test\n```\n\n---\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n\n---\n\n## Security contact information\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security). Tidelift will\ncoordinate the fix and disclosure.\n\n","_attachments":{},"homepage":"https://github.com/MoOx/reduce-function-call#readme","bugs":{"url":"https://github.com/MoOx/reduce-function-call/issues"},"license":"MIT"}