Socket
Socket
Sign inDemoInstall

fast-memoize

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-memoize - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "fast-memoize",
"version": "2.0.0",
"version": "2.0.1",
"description": "Fastest memoization lib that supports N arguments",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -43,2 +43,33 @@ <img src="http://rawgit.com/caiogondim/fast-memoize/master/img/icon.svg" width="100%" />

### Custom cache
The fastest cache is used for the running enviroment, but it is possible to
pass a custom cache to be used.
```js
const memoized = memoize(fn, {
cache: customCache
})
```
The custom cache must implement the following methods:
- `get`
- `set`
- `has`
- `delete`
### Custom serializer
To use a custom serializer:
```js
const memoized = memoize(fn, {
serializer: customSerializer
})
```
The serializer is a function that receives one argument and outputs a string
that represents it. It has to be a
[deterministic algorithm](https://en.wikipedia.org/wiki/Deterministic_algorithm)
meaning that, given one input, it always give the same output.
## Benchmark

@@ -45,0 +76,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc