All Versions
Latest Version
Avg Release Cycle
79 days
Latest Release
1242 days ago

Changelog History
Page 1

  • v8.0.0 Changes

    October 10, 2020

    ๐Ÿ’ฅ Breaking

    • ๐Ÿ“ฆ Convert the package to TypeScript (#64) 0b5c364
      The types might be slightly different than v6.
    • Require Node.js 10 (#67) 1afa53c
    • Throw on .clear(fn) if fnโ€™s cache can't be cleared (#59) e7c8893


    What happened to v7? This version was prematurely published as v7, so we did v8 to prevent breaking for those already on v7.

  • v6.1.1 Changes

    August 29, 2020
    • ๐ŸŽ Slightly improve performance (#57) ea88c5c
    • โช Revert "Automatically use WeakMap when possible" (#58) 3ffde5d


  • v6.1.0 Changes

    April 12, 2020
    • Automatically use WeakMap when possible (#56) e8bb86c


  • v6.0.1 Changes

    November 29, 2019
    • ๐Ÿ‘Œ Support overloaded functions (TypeScript types) (#48) 809697d
  • v6.0.0 Changes

    November 11, 2019

    ๐Ÿ’ฅ Breaking

    • 0๏ธโƒฃ Simplify the default cacheKey (#43) b7a0766
      ๐Ÿ‘€ It now defaults to cacheKey: x => x instead of the much more complicated previous default. This means it will now only cache the first argument, and only if it's a primitive. Previously, it tried to cache all arguments using JSON.stringify(), but this was both error-prone and slow. This change makes the memoization logic very straightforward, explicit and fast by default. See the readme for how to handle multi-argument or non-primitive value situations.
    • โฌ‡๏ธ Drop the cachePromiseRejection option (#43) b7a0766
      It was not a good fit for mem and we plan to add it to p-memoize instead (sindresorhus/p-memoize#11), which is like mem, but focused on promises. If you depend on this option, you should stay on mem v5 until sindresorhus/p-memoize#11 is resolved.
    • Throw when .clear() is called with a non-memoized function (#44) c73c23b


  • v5.1.1 Changes

    June 29, 2019
    • Always use an object for the cache item to match expectations and the TypeScript definitions (#42) 1f38c3e


  • v5.1.0 Changes

    June 15, 2019

    โœจ Enhancements:

    • ๐ŸŽ Minor performance optimization (#39) c098182


  • v5.0.0 Changes

    May 17, 2019

    ๐Ÿ’ฅ Breaking:

    • Require Node.js 8 e54b59b
    • ๐Ÿ”„ Change the default value of the cachePromiseRejection option to true (#36) 70707ae
      0๏ธโƒฃ We decided it's better to default to the least surprising/magic behavior.

    ๐Ÿ’ฅ Breaking for TypeScript users:

    • Only use a CommonJS export for the TypeScript definition
      You need to change import mem from 'mem'; to import mem = require('mem');

    โœจ Enhancements:

    • Cache function reference when it's a single argument (#35) 10f13c0


  • v4.3.0 Changes

    March 31, 2019
    • ๐Ÿ”จ Refactor TypeScript definition to use CJS compatible export (#32) 9a432b9
    • TypeScript - Fix the cache type (#29) 298a71e


  • v4.2.0 Changes

    March 12, 2019