Split source in several files. Generate API documentation. Add eslinter. #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I like your library! Thanks. But I miss more documentation, so I always end reading the source code (I've learn a lot of dsp by doing it, by the way), but I feel it's too long. So here's my my contribution:
Basically I've splited the source code in modules. To prevent errors I've installed an eslinter (following your syntax conventions). I didn't modify anything inside code except the some eslinter warnings (like some missing
new
operators beforeFloat32Array
).Now that the code is splitted, the
dsp.js
replacement is now generated intodist/dsp.js
(and you get a minified version too). As bonus, users can require the modules individually to save space if only need some part of the library:require('dsp.js/lib/fft')
Then I modifed the benchmarks and the examples to run against the new generated source file and test that everything continue to working exactly the same (as far as I could: big part of the examples are too old to be running in modern browsers).
Then I've add missing jsdoc documentation, and generate the
docs/API.md
file.If you feel this valuable and merge it, I would like to give some more love to the code, like writing more tests or refactoring some code to unify the style (like
Biquad
that usesthis
instead ofprototype
to define methods).I would be very nice to publish it into npm.
Hope you like it!
Summary of changes:
lib/
dist/
(replaces the olddsp.js
file)docs/
dsp.min.js
file