* Memoizes the return value of a function that accepts one string argument. * * @param {function} callback * @return {function}
(callback)
| 19106 | */ |
| 19107 | |
| 19108 | function memoizeStringOnly(callback) { |
| 19109 | var cache = {}; |
| 19110 | return function (string) { |
| 19111 | if (!cache.hasOwnProperty(string)) { |
| 19112 | cache[string] = callback.call(this, string); |
| 19113 | } |
| 19114 | return cache[string]; |
| 19115 | }; |
| 19116 | } |
| 19117 | |
| 19118 | module.exports = memoizeStringOnly; |
| 19119 | },{}],163:[function(_dereq_,module,exports){ |
no outgoing calls
no test coverage detected
searching dependent graphs…