Skip to content

Commit

Permalink
fix error in docs and improve tests
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
borisdiakur committed May 8, 2021
1 parent 50fb134 commit 616aa8a
Show file tree
Hide file tree
Showing 5 changed files with 323 additions and 297 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sudo: false
language: node_js
node_js:
- '10'
- '12'
- '13'
- '14'
- '15'
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ to be able to cache properly the return result of memoized function containing a
const memoizeFs = require('memoize-fs')
const serialize = require('serialize-javascript')

const deserialize = (serializedJsString) => eval(`(${serializedJsString})`)
// Note: For the sake of the example we use eval in the next line of code. eval is dangegrous
// in most cases. Don't do this at home, or anywhere else, unless you know what you are doing.
const deserialize = (serializedJsString) => eval(`(() => (${serializedJavascript}))()`).data
const memoizer = memoizeFs({ cachePath: './cache', serialize, deserialize })
Expand Down
Loading

0 comments on commit 616aa8a

Please sign in to comment.