{"_id":"function.apply-x","name":"function.apply-x","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"function.apply-x","version":"1.0.0","description":"Function.prototype.apply()","keywords":["function","apply"],"homepage":"https://github.com/xsfj/function-apply#readme","bugs":{"url":"https://github.com/xsfj/function-apply/issues"},"repository":{"type":"git","url":"git+https://github.com/xsfj/function-apply.git"},"license":"MIT","author":{"name":"Fox Jones"},"type":"commonjs","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"65b63c590f764346e54cd143ba27b886f490ff58","_id":"function.apply-x@1.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-j2AkYryWRSHYDySZfzBbDKsjJviWmJM4r361+GnDXPnZ6ie7WGzNesXmFDi9xMWQXVaFUSAT2nyq47QYz1wZIQ==","shasum":"338af9fb729e5c4a80f4af225a5988c81ba3fe42","tarball":"https://registry.npmjs.org/function.apply-x/-/function.apply-x-1.0.0.tgz","fileCount":3,"unpackedSize":2166,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCTchue4YXkrn5c919LFkdF5opzks5v/M4feR3/4P1+6QIhAPJ1sI3QJapD5AG4s0XyEqAwwQs5TymiubCK9rTRY4oJ"}]},"_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/function.apply-x_1.0.0_1766351120111_0.23777667449277318"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-21T21:05:20.109Z","1.0.0":"2025-12-21T21:05:20.246Z","modified":"2025-12-21T21:05:20.545Z"},"maintainers":[{"name":"xsfj","email":"oagde5@gmail.com"}],"description":"Function.prototype.apply()","homepage":"https://github.com/xsfj/function-apply#readme","keywords":["function","apply"],"repository":{"type":"git","url":"git+https://github.com/xsfj/function-apply.git"},"author":{"name":"Fox Jones"},"bugs":{"url":"https://github.com/xsfj/function-apply/issues"},"license":"MIT","readme":"# function.apply-x\r\n\r\nRobustly caches `Function.prototype.apply` for reliable usage across environments.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install function.apply-x\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nconst apply = require('function.apply-x');\r\n\r\nfunction greet(greeting, name) {\r\n  return `${greeting}, ${name}!`;\r\n}\r\n\r\n// Use apply to call the function with an array of arguments\r\nconst result = apply.call(greet, null, ['Hello', 'World']);\r\nconsole.log(result); // \"Hello, World!\"\r\n```\r\n\r\n## Why?\r\n\r\nThis module caches a reference to the native `Function.prototype.apply` method. This is useful in scenarios where:\r\n\r\n- You need to ensure you're using the original, unmodified `apply` method\r\n- Third-party code may have modified or overridden `Function.prototype.apply`\r\n- You want to protect against prototype pollution\r\n- You're building low-level utility libraries that need guaranteed native behavior\r\n\r\n## API\r\n\r\nThe module exports the cached `Function.prototype.apply` method directly.\r\n\r\n```javascript\r\napply.call(func, thisArg, argsArray)\r\n```\r\n\r\n- **func**: The function to invoke\r\n- **thisArg**: The value to use as `this` when calling the function\r\n- **argsArray**: An array of arguments to pass to the function\r\n\r\n## Example\r\n\r\n```javascript\r\nconst apply = require('function.apply-x');\r\n\r\nconst obj = {\r\n  value: 42,\r\n  getValue: function(multiplier, offset) {\r\n    return this.value * multiplier + offset;\r\n  }\r\n};\r\n\r\nconst result = apply.call(obj.getValue, obj, [2, 10]);\r\nconsole.log(result); // 94\r\n```\r\n\r\n## License\r\n\r\nMIT","readmeFilename":"README.md","_rev":"1-ed37779a35a82694b3e6f56a90fbcaaa"}