diff --git a/.travis.yml b/.travis.yml index 7d69d741..2ae9d62a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: + - '10' - '8' - '6' - - '4' diff --git a/index.js b/index.js index 89f024d4..9df569a3 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,11 @@ 'use strict'; -const toBytes = s => Array.from(s).map(c => c.charCodeAt(0)); +const toBytes = s => [...s].map(c => c.charCodeAt(0)); const xpiZipFilename = toBytes('META-INF/mozilla.rsa'); const oxmlContentTypes = toBytes('[Content_Types].xml'); const oxmlRels = toBytes('_rels/.rels'); module.exports = input => { - const buf = (input instanceof Uint8Array) ? input : new Uint8Array(input); + const buf = input instanceof Uint8Array ? input : new Uint8Array(input); if (!(buf && buf.length > 1)) { return null; @@ -278,7 +278,7 @@ module.exports = input => { if (idPos !== -1) { const docTypePos = idPos + 3; - const findDocType = type => Array.from(type).every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); + const findDocType = type => [...type].every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); if (findDocType('matroska')) { return { diff --git a/package.json b/package.json index 9472afe9..28bce02c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=4" + "node": ">=6" }, "scripts": { "test": "xo && ava"