lmaccherone / node-localstorage

A drop-in substitute for the browser native localStorage API that runs on node.js.
MIT License
450 stars 36 forks source link

fix the `options` argument to `writeFileSync` #57

Closed samjross closed 3 years ago

samjross commented 4 years ago

I noticed that you were sending 'utf8' as the options argument to the write-file-atomic sync method. I saw that that method expects an object instead of a string, and I set some breakpoints to verify that there's no point where it does something like check if it's a string and does something different, and it turns out, nope, if you send it a string it just ignores it.

Note: 'utf8' is the default encoding even if you didn't supply that argument.