From 726b6dc4b3b12c5010faa1685392f986229b28f1 Mon Sep 17 00:00:00 2001 From: Hem Brahmbhatt Date: Thu, 24 Aug 2017 11:07:42 +0100 Subject: [PATCH] linting --- lib/configure-map.js | 2 +- profile.js | 20 ++++++++++---------- test/profile.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/configure-map.js b/lib/configure-map.js index 0d4387f..8499a4a 100644 --- a/lib/configure-map.js +++ b/lib/configure-map.js @@ -90,7 +90,7 @@ module.exports = function (original, length, options) { conf = { original: original, memoized: memoized, - profileName: options.profileName, + profileName: options.profileName, get: function (args) { if (resolve) args = resolve(args); if (get) return get(args); diff --git a/profile.js b/profile.js index db9e8d3..e9d88f5 100644 --- a/profile.js +++ b/profile.js @@ -15,16 +15,16 @@ var partial = require('es5-ext/function/#/partial') Object.defineProperty(memoize, '__profiler__', d(function (conf) { var id, source, data, stack; stack = (new Error()).stack; - if (!stack || !stack.split('\n').slice(3).some(function (line) { - if ((line.indexOf('/memoizee/') === -1) && - (line.indexOf(' (native)') === -1)) { - source = line.replace(/\n/g, "\\n").trim(); - return true; - } - })) { - source = 'unknown'; - } - id = compact.call([conf.profileName, source]).join(', '); + if (!stack || !stack.split('\n').slice(3).some(function (line) { + if ((line.indexOf('/memoizee/') === -1) && + (line.indexOf(' (native)') === -1)) { + source = line.replace(/\n/g, "\\n").trim(); + return true; + } + })) { + source = 'unknown'; + } + id = compact.call([conf.profileName, source]).join(', '); if (!stats[id]) stats[id] = { initial: 0, cached: 0 }; data = stats[id]; diff --git a/test/profile.js b/test/profile.js index f09112d..c90feff 100644 --- a/test/profile.js +++ b/test/profile.js @@ -4,7 +4,7 @@ var memoize = require('../plain'); module.exports = function (t, a) { memoize(function () {})(); - memoize(function () {}, { profileName: 'test' })(); + memoize(function () {}, { profileName: 'test' })(); a(typeof t.statistics, 'object', "Access to statistics"); a(Object.keys(t.statistics).length, 2, "Statistics collected including named function"); a(typeof t.log, 'function', "Access to log function");