You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

has

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

5

package.json
{
"name": "has",
"description": "Object.prototype.hasOwnProperty.call shortcut",
"version": "1.0.3",
"version": "1.0.4",
"homepage": "https://github.com/tarruda/has",

@@ -32,5 +32,2 @@ "author": {

"main": "./src",
"dependencies": {
"function-bind": "^1.1.1"
},
"devDependencies": {

@@ -37,0 +34,0 @@ "@ljharb/eslint-config": "^12.2.1",

7

src/index.js
'use strict';
var bind = require('function-bind');
var hasOwnProperty = {}.hasOwnProperty;
var call = Function.prototype.call;
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
module.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {
return call.call(hasOwnProperty, O, P);
};

@@ -9,3 +9,9 @@ 'use strict';

t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"');
t['throws'](function () {
has(null, 'throws');
}, TypeError, 'calling has on null throws TypeError');
t['throws'](function () {
has(void 0, 'throws');
}, TypeError, 'calling has on undefined throws TypeError');
t.end();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc