{"_id":"uncurry-x","_rev":"2-a047fccf9c4b67db8b6e5a02cdffbdb4","name":"uncurry-x","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"uncurry-x","version":"1.0.0","keywords":["uncurry","uncurry-x","call-bind","methodize","prototype","static","call","bind","apply","function","es-abstract","shim","polyfill","legacy","limitless"],"author":{"url":"xsfj","name":"Fox Jones"},"license":"MIT","_id":"uncurry-x@1.0.0","maintainers":[{"name":"xsfj","email":"oagde5@gmail.com"}],"homepage":"https://github.com/xsfj/uncurry-x#readme","bugs":{"url":"https://github.com/xsfj/uncurry-x/issues"},"dist":{"shasum":"c98fb2f72701c42e1563d8f32a04d6cb77fe392e","tarball":"https://registry.npmjs.org/uncurry-x/-/uncurry-x-1.0.0.tgz","fileCount":4,"integrity":"sha512-0VfSWx6hUUQm70hHDNuvGl4Bg9+mhJUT2Lde0Lwc6p02Li+bJq6jhxw+9PD/qNg5k4CKviYJOMJJonqapi7Nrg==","signatures":[{"sig":"MEYCIQC43RRWFCLw33xT2uB770rxBEEmPUa+/0T6x7SMfNoyPgIhALnzsSuN/lbJnEyHHTNzmvOulBVe2QmOB23QY5EswGMN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9072},"main":"index.js","type":"commonjs","gitHead":"fee9ef827c5fb062ec5ed33aad02a22ccabdde80","scripts":{"test":"tape test/uncurry.js"},"_npmUser":{"name":"xsfj","email":"oagde5@gmail.com"},"repository":{"url":"git+https://github.com/xsfj/uncurry-x.git","type":"git"},"_npmVersion":"11.6.2","description":"Standard uncurryThis utility for method-to-function transformation with full legacy environment support.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"function.call-x":"^1.0.0","set-function-length":"^1.2.2","define-data-property":"^1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.9.0"},"_npmOperationalInternal":{"tmp":"tmp/uncurry-x_1.0.0_1766448008365_0.27367865382430856","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"uncurry-x","version":"1.0.1","description":"Standard uncurryThis utility for method-to-function transformation with full legacy environment support.","keywords":["uncurry","uncurry-x","call-bind","methodize","prototype","static","call","bind","apply","function","es-abstract","shim","polyfill","legacy","limitless"],"homepage":"https://github.com/xsfj/uncurry-x#readme","bugs":{"url":"https://github.com/xsfj/uncurry-x/issues"},"repository":{"type":"git","url":"git+https://github.com/xsfj/uncurry-x.git"},"license":"MIT","author":{"name":"Fox Jones","url":"xsfj"},"type":"commonjs","main":"index.js","scripts":{"test":"tape test/uncurry.js"},"devDependencies":{"tape":"^5.9.0"},"dependencies":{"define-data-property":"^1.1.4","function.call-x":"^1.0.0","set-function-length":"^1.2.2"},"gitHead":"4b743abd65a81b60f5dd1f61bf6a1585e104643e","_id":"uncurry-x@1.0.1","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-lb1WMrKXwSwVE8Us8FSTUw+sImeOo0nBKrGghZIzSYvTVJ0njOhVnbolA2F06ATKJFvFm1gHYSiGNiwrBIzatA==","shasum":"7a76559e4d293acb9e7180d64da42061e0745e78","tarball":"https://registry.npmjs.org/uncurry-x/-/uncurry-x-1.0.1.tgz","fileCount":4,"unpackedSize":9048,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB88SZI6OF18HyfJZOskm3D9QO4UjLI8AWOk5KHfLYyrAiEAtKKZWtvZQ9+iDDkFDDxS3tunKruc7NXu97vUYcOBV9o="}]},"_npmUser":{"name":"xsfj","email":"oagde5@gmail.com"},"directories":{},"maintainers":[{"name":"xsfj","email":"oagde5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uncurry-x_1.0.1_1766448221294_0.5642104239939658"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-23T00:00:08.364Z","modified":"2025-12-23T00:03:41.624Z","1.0.0":"2025-12-23T00:00:08.524Z","1.0.1":"2025-12-23T00:03:41.437Z"},"bugs":{"url":"https://github.com/xsfj/uncurry-x/issues"},"author":{"name":"Fox Jones","url":"xsfj"},"license":"MIT","homepage":"https://github.com/xsfj/uncurry-x#readme","keywords":["uncurry","uncurry-x","call-bind","methodize","prototype","static","call","bind","apply","function","es-abstract","shim","polyfill","legacy","limitless"],"repository":{"type":"git","url":"git+https://github.com/xsfj/uncurry-x.git"},"description":"Standard uncurryThis utility for method-to-function transformation with full legacy environment support.","maintainers":[{"name":"xsfj","email":"oagde5@gmail.com"}],"readme":"# uncurry-x\r\n\r\nCreates an uncurried version of a function that takes `this` as the first argument.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install uncurry-x\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nvar uncurryThis = require(\"uncurry-x\")\r\n\r\nfunction greet(name) {\r\n  return this.greeting + \", \" + name + \"!\"\r\n}\r\n\r\nvar greetUnbound = uncurryThis(greet)\r\n\r\nvar context = { greeting: \"Hello\" }\r\ngreetUnbound(context, \"World\") // \"Hello, World!\"\r\n\r\n// Works even after Function.prototype methods are deleted\r\ndelete Function.prototype.call\r\ndelete Function.prototype.bind\r\n\r\ngreetUnbound(context, \"World\") // still works!\r\n```\r\n\r\n## API\r\n\r\n### `uncurryThis(fn)`\r\n\r\nTakes a function and returns an uncurried version where `this` becomes the first parameter.\r\n\r\n**Parameters:**\r\n\r\n- `fn` (Function): The function to uncurry\r\n\r\n**Returns:**\r\n\r\n- (Function): The uncurried function with `length` set to `originalLength + 1`\r\n\r\n### `.apply` helper\r\n\r\nThe returned function has an `.apply` method that works like `Function.prototype.apply`:\r\n\r\n```javascript\r\nvar slice = uncurryThis(Array.prototype.slice)\r\n\r\n// Using .apply\r\nslice.apply(null, [[10, 20, 30, 40], 1, 3]) // [20, 30]\r\n\r\n// Equivalent to:\r\nslice([10, 20, 30, 40], 1, 3) // [20, 30]\r\n```\r\n\r\n## Examples\r\n\r\n### Array methods\r\n\r\n```javascript\r\nvar map = uncurryThis(Array.prototype.map)\r\nvar join = uncurryThis(Array.prototype.join)\r\n\r\nvar numbers = [1, 2, 3]\r\nvar doubled = map(numbers, function (x) {\r\n  return x * 2\r\n}) // [2, 4, 6]\r\njoin(doubled, \"-\") // \"2-4-6\"\r\n```\r\n\r\n### String methods\r\n\r\n```javascript\r\nvar split = uncurryThis(String.prototype.split)\r\nvar toLowerCase = uncurryThis(String.prototype.toLowerCase)\r\n\r\nsplit(\"foo-bar-baz\", \"-\") // [\"foo\", \"bar\", \"baz\"]\r\ntoLowerCase(\"HELLO\") // \"hello\"\r\n```\r\n\r\n### Custom methods\r\n\r\n```javascript\r\nfunction Counter(start) {\r\n  this.count = start\r\n}\r\n\r\nCounter.prototype.increment = function (amount) {\r\n  this.count += amount\r\n  return this.count\r\n}\r\n\r\nvar increment = uncurryThis(Counter.prototype.increment)\r\nvar counter = new Counter(10)\r\n\r\nincrement(counter, 5) // 15\r\n```\r\n\r\n## Features\r\n\r\n- ES3 compatible\r\n- Preserves function `length` property correctly\r\n- Works even after `Function.prototype.call` and `Function.prototype.bind` are deleted\r\n- Includes `.apply` helper method\r\n- Uses cached references to native methods for maximum reliability\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}