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

tar-stream-compat

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

tar-stream-compat - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

49

Buffer/compare.js

@@ -1,20 +0,3 @@

var typedArrayPrototoStringTag = require('which-typed-array')
var isInteger = require('is-integer')
var major = +process.versions.node.split('.')[0]
function isUint8Array (value) {
var tag = typedArrayPrototoStringTag(value)
return tag === 'Uint8Array' || tag === false
}
var min = -2147483648
var max = 2147483647
function validateInt32 (value) {
return isInteger(value) && value >= min && value <= max
}
var ERR_INVALID_ARG_TYPE = Error
function compareOffset (source, target, targetStart, sourceStart, targetEnd,

@@ -25,6 +8,8 @@ sourceEnd) {

var length = Math.min(sourceLength, targetLength)
var sourceValue
var targetValue
for (var index = 0; index < length; index++) {
var sourceValue = source[sourceStart + index]
var targetValue = target[targetStart + index]
sourceValue = source[sourceStart + index]
targetValue = target[targetStart + index]
if (sourceValue > targetValue) return 1

@@ -37,20 +22,10 @@ else if (sourceValue < targetValue) return -1

function bufferComparePolyfill (source, target, targetStart, targetEnd, sourceStart, sourceEnd) {
if (!isUint8Array(target)) {
throw new ERR_INVALID_ARG_TYPE('target', ['Buffer', 'Uint8Array'], target)
}
if (arguments.length === 1) { return source.compare(target) }
if (targetStart === undefined) { targetStart = 0 } else { validateInt32(targetStart, 'targetStart', 0) }
if (targetEnd === undefined) { targetEnd = target.length } else { validateInt32(targetEnd, 'targetEnd', 0, target.length) }
if (sourceStart === undefined) { sourceStart = 0 } else { validateInt32(sourceStart, 'sourceStart', 0) }
if (sourceEnd === undefined) { sourceEnd = source.length } else { validateInt32(sourceEnd, 'sourceEnd', 0, source.length) }
if (sourceStart >= sourceEnd) { return (targetStart >= targetEnd ? 0 : -1) }
if (targetStart >= targetEnd) { return 1 }
return compareOffset(source, target, targetStart, sourceStart, targetEnd,
sourceEnd)
if (arguments.length === 1) return source.compare(target)
if (targetStart === undefined) targetStart = 0
if (targetEnd === undefined) targetEnd = target.length
if (sourceStart === undefined) sourceStart = 0
if (sourceEnd === undefined) sourceEnd = source.length
if (sourceStart >= sourceEnd) return (targetStart >= targetEnd ? 0 : -1)
if (targetStart >= targetEnd) return 1
return compareOffset(source, target, targetStart, sourceStart, targetEnd, sourceEnd)
}

@@ -57,0 +32,0 @@

{
"name": "tar-stream-compat",
"version": "2.1.3",
"version": "2.1.4",
"description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.",

@@ -12,5 +12,3 @@ "author": "Mathias Buus <mathiasbuus@gmail.com>",

"inherits": "^2.0.4",
"is-integer": "^1.0.7",
"readable-stream": "^2.3.7",
"which-typed-array": "^1.1.2"
"readable-stream": "^2.3.7"
},

@@ -17,0 +15,0 @@ "devDependencies": {

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