From 5dd98ea47f9cb25d42b408c2d9b3175285c6fd80 Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 11 Apr 2019 10:00:21 +0800 Subject: [PATCH] perf[mock-server]: optimize variable name --- mock/mock-server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mock/mock-server.js b/mock/mock-server.js index fcb931ad..b29b7c3f 100644 --- a/mock/mock-server.js +++ b/mock/mock-server.js @@ -3,16 +3,16 @@ const bodyParser = require('body-parser') const chalk = require('chalk') function registerRoutes(app) { - let mockStartIndex + let mockLastIndex const { default: mocks } = require('./index.js') for (const mock of mocks) { app[mock.type](mock.url, mock.response) - mockStartIndex = app._router.stack.length + mockLastIndex = app._router.stack.length } const mockRoutesLength = Object.keys(mocks).length return { mockRoutesLength: mockRoutesLength, - mockStartIndex: mockStartIndex - mockRoutesLength + mockStartIndex: mockLastIndex - mockRoutesLength } }