* Memoizes the return value of a function that accepts one string argument. * * @param {function} callback * @return {function}
(callback)
| 18528 | * @return {function} |
| 18529 | */ |
| 18530 | function memoizeStringOnly(callback) { |
| 18531 | var cache = {}; |
| 18532 | return function (string) { |
| 18533 | if (!cache.hasOwnProperty(string)) { |
| 18534 | cache[string] = callback.call(this, string); |
| 18535 | } |
| 18536 | return cache[string]; |
| 18537 | }; |
| 18538 | } |
| 18539 | |
| 18540 | module.exports = memoizeStringOnly; |
| 18541 | },{}],150:[function(_dereq_,module,exports){ |