Closed sinikami closed 4 years ago
function stringify (obj, options = {}) { const EOL = options.EOL || '\n' const str = JSON.stringify(obj, options ? options.replacer : null, options.spaces) return str.replace(/\n/g, EOL) + EOL }
Add a new EOL makes it different with origin source.
I saved hash in JSON.stringify(...), but it is different with hashing from file because of a final EOL was added.
Ending files with a newline is a strong Unix/git convention, and I don't think we should deviate from it.
Add a new EOL makes it different with origin source.
I saved hash in JSON.stringify(...), but it is different with hashing from file because of a final EOL was added.