Skip to content

Commit

Permalink
Revert "feat(reporter): Replace memoizee library with a trivial solut…
Browse files Browse the repository at this point in the history
…ion."
  • Loading branch information
zzo committed Oct 12, 2015
1 parent 297eef6 commit eafb1db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var log = require('./logger').create('reporter')
var MultiReporter = require('./reporters/multi')
var baseReporterDecoratorFactory = require('./reporters/base').decoratorFactory
var SourceMapConsumer = require('source-map').SourceMapConsumer
var memoizeWeak = require('memoizee/weak')

var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) {
var lastServedFiles = []
Expand All @@ -28,15 +29,9 @@ var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) {
'(\\:(\\d+))?' + // column
'', 'g')

var getSourceMapConsumer = (function () {
var cache = {}
return function (sourceMap) {
if (!(sourceMap in cache)) {
cache[sourceMap] = new SourceMapConsumer(sourceMap)
}
return cache[sourceMap]
}
}())
var getSourceMapConsumer = memoizeWeak(function (sourceMap) {
return new SourceMapConsumer(sourceMap)
})

return function (msg, indentation) {
// remove domain and timestamp from source files
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
"http-proxy": "^1.11.1",
"lodash": "^3.8.0",
"log4js": "^0.6.25",
"memoizee": "^0.3.8",
"mime": "^1.3.4",
"minimatch": "^2.0.7",
"optimist": "^0.6.1",
Expand Down

0 comments on commit eafb1db

Please sign in to comment.