From 4a0fe2c17b7dc5e277f451a000c072d8841e7a6e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 21 Feb 2016 18:51:42 -0800 Subject: [PATCH] Use `lodash` in test/remove.js. --- test/remove.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/remove.js b/test/remove.js index 7dde79caa..bd5aaf927 100644 --- a/test/remove.js +++ b/test/remove.js @@ -1,15 +1,15 @@ #!/usr/bin/env node 'use strict'; -var fs = require('fs'), +var _ = require('../lodash'), + fs = require('fs'), path = require('path'); var args = (args = process.argv) .slice((args[0] === process.execPath || args[0] === 'node') ? 2 : 0); var filePath = path.resolve(args[1]), - reLine = /.*/gm, - slice = Array.prototype.slice; + reLine = /.*/gm; var pattern = (function() { var result = args[0], @@ -22,6 +22,6 @@ var pattern = (function() { /*----------------------------------------------------------------------------*/ fs.writeFileSync(filePath, fs.readFileSync(filePath, 'utf8').replace(pattern, function(match) { - var snippet = slice.call(arguments, -3, -1)[0]; + var snippet = _.slice(arguments, -3, -2)[0]; return match.replace(snippet, snippet.replace(reLine, '')); }));