cheminfo-js / spectra-data

Library to deal with spectra (IR, UV, ...), 1D NMR as well as 2D NMR
https://cheminfo-js.github.io/spectra-data
MIT License
4 stars 0 forks source link

Better to have function XXX than var XXX=function #39

Closed lpatiny closed 7 years ago

lpatiny commented 7 years ago

https://github.com/cheminfo-js/spectra-data/blob/e92167314d912e1ddd57169fb2d3f9d9b5110ff5/src/jcampEncoder/VectorEncoder.js#L66

andcastillo commented 7 years ago

I'll try to fix those old thing everywhere. By now I've fixed it in the code you hint

lpatiny commented 7 years ago

You could make a query by regular expressions in order to find all the '= function'

andcastillo commented 7 years ago

I did. But, what if I directly export the function? module.exports.myFunction = function (var1, opts) Did you say something about to create a named function and export it after? @targos @lpatiny

targos commented 7 years ago

say something about to create a named function and export it after?

That's what I usually do but you can also write module.exports.myFunction = function myfunction(){}