diff --git a/lib/actions/copy-tpl.js b/lib/actions/copy-tpl.js index a1656b1..381a82a 100644 --- a/lib/actions/copy-tpl.js +++ b/lib/actions/copy-tpl.js @@ -2,13 +2,13 @@ var extend = require('deep-extend'); var ejs = require('ejs'); -var isBinaryFile = require('isbinaryfile'); +var isBinaryFileSync = require('isbinaryfile').isBinaryFileSync; function render(contents, filename, context, tplSettings) { let result; const contentsBuffer = Buffer.from(contents, 'binary'); - if (isBinaryFile.sync(contentsBuffer, contentsBuffer.length)) { + if (isBinaryFileSync(contentsBuffer, contentsBuffer.length)) { result = contentsBuffer; } else { result = ejs.render( @@ -26,10 +26,15 @@ module.exports = function (from, to, context, tplSettings, options) { context = context || {}; tplSettings = tplSettings || {}; - this.copy(from, to, extend(options || {}, { - process: function (contents, filename) { - return render(contents, filename, context, tplSettings); - } - }), - context, tplSettings); + this.copy( + from, + to, + extend(options || {}, { + process: function (contents, filename) { + return render(contents, filename, context, tplSettings); + } + }), + context, + tplSettings + ); }; diff --git a/package-lock.json b/package-lock.json index cc88623..fe0e35e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -741,9 +741,9 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" }, "array-differ": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.0.3.tgz", - "integrity": "sha1-AZW7AMzM8nEQbv7kpHhkiLcYBxI=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==" }, "array-equal": { "version": "1.0.0", @@ -776,9 +776,9 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" }, "asn1": { "version": "0.2.3", @@ -1051,25 +1051,6 @@ "node-int64": "^0.4.0" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -3239,12 +3220,9 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isbinaryfile": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", - "requires": { - "buffer-alloc": "^1.2.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.0.tgz", + "integrity": "sha512-RBtmso6l2mCaEsUvXngMTIjg3oheXo0MgYzzfT6sk44RYggPnm9fT+cQJAmzRnJIxPHXg9FZglqDJGW28dvcqA==" }, "isexe": { "version": "2.0.0", @@ -4488,14 +4466,22 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", "minimatch": "^3.0.4" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + } } }, "mute-stream": { diff --git a/package.json b/package.json index 8b1e559..438db2b 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,9 @@ "ejs": "^2.6.1", "glob": "^7.1.4", "globby": "^9.2.0", - "isbinaryfile": "^3.0.3", + "isbinaryfile": "^4.0.0", "mkdirp": "^0.5.0", - "multimatch": "^3.0.0", + "multimatch": "^4.0.0", "rimraf": "^2.6.3", "through2": "^3.0.1", "vinyl": "^2.2.0"