From 15dff3437b05dd63f88eb45ebb07b4b19b764dc4 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 30 Jan 2016 04:08:19 +0100 Subject: [PATCH] simplify #74 --- index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index f8ad5d6..73b2806 100644 --- a/index.js +++ b/index.js @@ -7,12 +7,8 @@ var objectAssign = require('object-assign'); var replaceExt = require('replace-ext'); var babel = require('babel-core'); -function replaceExtension(filepath) { - if (path.extname(filepath)) { - return replaceExt(filepath, '.js'); - } - - return filepath; +function replaceExtension(fp) { + return path.extname(fp) ? replaceExt(fp, '.js') : fp; } module.exports = function (opts) {