From 6d848cbdea4e8fb7dfe50418e009c120bdd1cab9 Mon Sep 17 00:00:00 2001 From: Chen Yangjian <252317+cyjake@users.noreply.github.com> Date: Wed, 26 Dec 2018 15:47:13 +0800 Subject: [PATCH] chore: fix typos & drop legacy workaround (#38) --- Makefile | 6 +++--- index.js | 6 +++--- node | 10 ---------- 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100755 node diff --git a/Makefile b/Makefile index df1110d..cc4d19f 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ jshint: install @-./node_modules/.bin/jshint ./ test: - @NODE_ENV=test ./node \ + @NODE_ENV=test node \ ./node_modules/mocha/bin/_mocha \ --reporter $(REPORTER) \ --timeout $(TIMEOUT) \ @@ -22,7 +22,7 @@ test: $(TESTS) test-cov: - @NODE_ENV=test ./node \ + @NODE_ENV=test node \ node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \ -- -u exports \ --reporter $(REPORTER) \ @@ -33,7 +33,7 @@ test-cov: $(TESTS) test-travis: - @NODE_ENV=test ./node \ + @NODE_ENV=test node \ node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \ --report lcovonly \ -- -u exports \ diff --git a/index.js b/index.js index 5ef882d..28da598 100644 --- a/index.js +++ b/index.js @@ -124,7 +124,7 @@ module.exports = function (options) { ctx.url, ctx.path, options.loginPath, !!ctx.session, loginRequired); if (!ctx.session) { - debug('ctx.session not exists'); + debug('ctx.session does not exist'); // ignore not match path if (!loginRequired) { debug('not match needLogin path, %j', ctx.path); @@ -142,7 +142,7 @@ module.exports = function (options) { // get login callback if (ctx.path === options.loginCallbackPath) { - debug('match login clalback path'); + debug('match login callback path'); return loginCallbackHandler(ctx); } @@ -161,7 +161,7 @@ module.exports = function (options) { if (ctx.session[options.userField] && options.loginCheck(ctx)) { // 4. user logined, next() handler - debug('already logined'); + debug('already logged in'); return next(); } diff --git a/node b/node deleted file mode 100755 index d73b7a1..0000000 --- a/node +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -var cp = require('child_process'); -var args = process.argv.slice(2); -if (/^0/.test(String(process.versions.node))) { - args.unshift('--harmony'); -} -cp.spawn('node', args, { stdio: 'inherit' });