be latest standard

This commit is contained in:
Mathias Buus 2018-04-26 16:57:03 +02:00
parent b6dd099d17
commit ebba4d3016
6 changed files with 9 additions and 8 deletions

View file

@ -9,7 +9,7 @@ var MASK = parseInt('7777', 8)
var clamp = function (index, len, defaultValue) { var clamp = function (index, len, defaultValue) {
if (typeof index !== 'number') return defaultValue if (typeof index !== 'number') return defaultValue
index = ~~index // Coerce to integer. index = ~~index // Coerce to integer.
if (index >= len) return len if (index >= len) return len
if (index >= 0) return index if (index >= 0) return index
index += len index += len

View file

@ -1,4 +1,4 @@
var constants = require('constants') var constants = require('fs-constants')
var eos = require('end-of-stream') var eos = require('end-of-stream')
var util = require('util') var util = require('util')
var alloc = require('buffer-alloc') var alloc = require('buffer-alloc')

View file

@ -10,14 +10,15 @@
"bl": "^1.0.0", "bl": "^1.0.0",
"buffer-alloc": "^1.1.0", "buffer-alloc": "^1.1.0",
"end-of-stream": "^1.0.0", "end-of-stream": "^1.0.0",
"fs-constants": "^1.0.0",
"readable-stream": "^2.0.0", "readable-stream": "^2.0.0",
"to-buffer": "^1.1.0", "to-buffer": "^1.1.0",
"xtend": "^4.0.0" "xtend": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"concat-stream": "^1.4.6", "concat-stream": "^1.6.2",
"standard": "^5.3.1", "standard": "^11.0.1",
"tape": "^3.0.3" "tape": "^4.9.0"
}, },
"scripts": { "scripts": {
"test": "standard && tape test/extract.js test/pack.js", "test": "standard && tape test/extract.js test/pack.js",

View file

@ -6,7 +6,7 @@ var fs = require('fs')
var clamp = function (index, len, defaultValue) { var clamp = function (index, len, defaultValue) {
if (typeof index !== 'number') return defaultValue if (typeof index !== 'number') return defaultValue
index = ~~index // Coerce to integer. index = ~~index // Coerce to integer.
if (index >= len) return len if (index >= len) return len
if (index >= 0) return index if (index >= 0) return index
index += len index += len

View file

@ -111,7 +111,7 @@ test('types', function (t) {
gname: 'staff', gname: 'staff',
uid: 501, uid: 501,
gid: 20, gid: 20,
size: 9 // Should convert to zero size: 9 // Should convert to zero
}) })
pack.finalize() pack.finalize()

View file

@ -10,7 +10,7 @@ test('huge', function (t) {
var extract = tar.extract() var extract = tar.extract()
var noEntries = false var noEntries = false
var hugeFileSize = 8804630528 // ~8.2GB var hugeFileSize = 8804630528 // ~8.2GB
var dataLength = 0 var dataLength = 0
var countStream = new stream.Writable() var countStream = new stream.Writable()