Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-type

Package Overview
Dependencies
Maintainers
20
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-type - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

14

index.js

@@ -29,9 +29,19 @@ /**

if (typeof Buffer != 'undefined' && Buffer.isBuffer(val)) return 'buffer';
if (isBuffer(val)) return 'buffer';
val = val.valueOf
? val.valueOf()
: Object.prototype.valueOf.apply(val)
: Object.prototype.valueOf.apply(val);
return typeof val;
};
// code borrowed from https://github.com/feross/is-buffer/blob/master/index.js
function isBuffer(obj) {
return !!(obj != null &&
(obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)
(obj.constructor &&
typeof obj.constructor.isBuffer === 'function' &&
obj.constructor.isBuffer(obj))
))
}

2

package.json
{
"name": "component-type",
"description": "Cross-browser type assertions (less broken typeof)",
"version": "1.2.0",
"version": "1.2.1",
"keywords": [

@@ -6,0 +6,0 @@ "typeof",

@@ -76,6 +76,7 @@ var type = require('type')

assert('object' === type(b));
window.Buffer = { isBuffer: function(val){ return val === b } };
assert('buffer' === type(b));
delete window.Buffer;
if (window.Buffer) {
var val = new Buffer(4);
assert('buffer' === type(val));
}
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc