tar-stream-compat
Advanced tools
Comparing version 2.1.3 to 2.1.4
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
29910
720
- Removedis-integer@^1.0.7
- Removedwhich-typed-array@^1.1.2
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-integer@1.0.7(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)