Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
language: node_js
addons:
chrome: stable
apt:
packages:
apt:
packages:
- xvfb
os:
- linux
before_install:
- npm install browser-run browserify -g
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
node_js:
- "8"
- "8"
2 changes: 1 addition & 1 deletion example/hello.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var random = require('../')('dbname')
var cool = random('cool.txt')
cool.write(100, new Buffer('GREETINGS'), function (err) {
cool.write(100, Buffer.from('GREETINGS'), function (err) {
if (err) return console.error(err)
cool.read(104, 3, function (err, buf) {
if (err) return console.error(err)
Expand Down
8 changes: 4 additions & 4 deletions lib/blocks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = function (size, start, end) {
var result = []
for (var n = Math.floor(start/size)*size; n < end; n += size) {
for (var n = Math.floor(start / size) * size; n < end; n += size) {
result.push({
block: Math.floor(n/size),
start: Math.max(n,start) % size,
end: Math.min(n+size,end) % size || size
block: Math.floor(n / size),
start: Math.max(n, start) % size,
end: Math.min(n + size, end) % size || size
})
}
return result
Expand Down
Loading