Skip to content

Commit

Permalink
Require Node.js 6
Browse files Browse the repository at this point in the history
  • Loading branch information
schnittstabil authored and sindresorhus committed May 12, 2018
1 parent e6244ea commit 7e3c6d2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
after_script:
- './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls'
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const path = require('path');
const fsConstants = require('fs').constants;
const Buffer = require('safe-buffer').Buffer;
const {Buffer} = require('safe-buffer');
const CpFileError = require('./cp-file-error');
const fs = require('./fs');
const ProgressEmitter = require('./progress-emitter');
Expand Down Expand Up @@ -55,8 +55,8 @@ module.exports = (src, dest, opts) => {
}
});

promise.on = function () {
progressEmitter.on.apply(progressEmitter, arguments);
promise.on = (...args) => {
progressEmitter.on(...args);
return promise;
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"engines": {
"node": ">=4"
"node": ">=6"
},
"scripts": {
"test": "xo && nyc ava"
Expand Down
3 changes: 1 addition & 2 deletions progress-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class ProgressEmitter extends EventEmitter {
}

emitProgress() {
const size = this.size;
const written = this.written;
const {size, written} = this;
this.emit('progress', {
src: this.src,
dest: this.dest,
Expand Down
2 changes: 1 addition & 1 deletion test/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ test.serial('rethrow mkdir EACCES errors', async t => {
});

test.serial('rethrow ENOSPC errors', async t => {
const createWriteStream = fs.createWriteStream;
const {createWriteStream} = fs;
const noSpaceError = buildENOSPC();
let called = false;

Expand Down
5 changes: 5 additions & 0 deletions test/helpers/assert.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/**
* Tests equality of Date objects, w/o considering milliseconds.
* @see {@link https://github.com/joyent/node/issues/7000|File timestamp resolution is inconsistent with fs.stat / fs.utimes}
*
* @param {Object} t - AVA's t
* @param {*} actual - the actual value
* @param {*} expected - the expected value
* @param {*} message - error message
*/
export default function assertDateEqual(t, actual, expected, message) {
actual = new Date(actual);
Expand Down

0 comments on commit 7e3c6d2

Please sign in to comment.