Socket
Socket
Sign inDemoInstall

moize

Package Overview
Dependencies
2
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous1
35
11Next

5.3.0

Diff

Changelog

Source

5.3.0

NEW FEATURES

planttheidea
published 5.2.3 •

Changelog

Source

5.2.3

BUGFIXES

  • Actually fix the issue that 5.2.2 was supposed to fix (appreciate the persistence @vlad-zhukov)
planttheidea
published 5.2.2 •

Changelog

Source

5.2.2

BUGFIXES

  • Fix issue where manually removing a key from cache would not clear / remove the expiration timeout
planttheidea
published 5.2.1 •

Changelog

Source

5.2.1

BUGFIXES

  • Fix Object.assign usage on functions (derp)
planttheidea
published 5.2.0 •

Changelog

Source

5.2.0

NEW FEATURES

  • Add collectStats as a convenience method on the main moize object

BUGFIXES

  • Fix naming convention for determining if statistics are being collected on the moized function (isCollectingStats now, was mistakenly collectStats before)
planttheidea
published 5.1.2 •

Changelog

Source

5.1.2

BUGFIXES

  • Reference the correct option name for micro-memoize (isMatchingKey) instead of moize (matchesKey) for instance methods (oops)
planttheidea
published 5.1.1 •

Changelog

Source

5.1.1

BUGFIXES

  • Ensure instance methods that update the cache work correctly with new matchesKey option
planttheidea
published 5.1.0 •

Changelog

Source

5.1.0

NEW FEATURES

  • Add matchesKey option
  • Change isSerialized to use matchesKey with custom isMatchingKey instead of standard isEqual

BUGFIXES

  • Prevent isDeepEqual from being passed to the micro-memoize options
planttheidea
published 5.0.1 •

Changelog

Source

5.0.1

  • Include fast-equals as an explicit dependency
planttheidea
published 5.0.0 •

Changelog

Source

5.0.0

  • Complete refactor to leverage micro-memoize under the hood (doubles the speed, and allows for more functionality)

BREAKING CHANGES

  • The default equals option now uses SameValueZero equality instead of strict equality
  • equals option is now performed iteratively on each argument in the key, rather on the key as a whole
    • matchesKey option now performs the full-key comparison that equals did in v4
  • serialize option has been changed to isSerialized
  • serializeFunctions option has been changed to shouldSerializeFunctions
  • CommonJS consumers must now use require('moize').default
  • The shape of the cache object has changed
    • If you were modifying it directly instead of using the convenience methods, you may experience breakages
  • moize.promise now sets both isPromise and updateExpire options (v4 and below only set isPromise)
  • When isPromise is true and a maxAge is applied, the maxAge now begins when the function is created rather than the resolution of the promise
    • If you want the maxAge to apply upon resolution, then either set the updateExpire option or use the moize.promise convenience method

NEW FEATURES

  • Deep equality now available without custom equals function (either isDeepEqual option, or moize.deep convenience method)
  • Statistics can now be collected for both global and method-specific contexts (see Collecting statistics and profileName)
  • Statistics-based introspection methods exist to support reading stats
    • getStats will get the stats for the profileName passed, or if none is passed then gets the global stats
    • isCollectingStats returns whether stats are being collected
  • Cache change listeners are now available to listen for changes
    • onCacheAdd will fire when a new entry is added to the cache
    • onCacheChange will fire when the cache is added to or the LRU order has changed
    • onCacheHit will fire when an existing entry in cache is used

BUGFIXES

  • isPromise methods that resolved had the values re-wrapped in a new promise, which obfuscated chaining on the method (now the original promise is maintained)
  • Internal de-circularizer for serialized methods was flaky in deeply-nested scenarios (now uses json-stringify-safe)

DEPRECATIONS

  • promiseLibrary is no longer a supported option (it is no longer needed, as the original promise is now maintained)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc