Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sortBy and filterBy functions should be merged #190

Closed
prjctimg opened this issue Apr 17, 2024 · 3 comments
Closed

feat: sortBy and filterBy functions should be merged #190

prjctimg opened this issue Apr 17, 2024 · 3 comments
Assignees

Comments

@prjctimg
Copy link
Owner

prjctimg commented Apr 17, 2024

I noticed that the API is a bit overkill in the collection methods. Instead of splitting them into sub functions, I'm proposing a refactor that allows extending functionality through parameters instead of invoking individual functions per factor.

This refactor would:

  • Reduce API complexity
  • Reduce lines of code and documentation
  • Keep the classes cleaner and less redundant
Copy link

Thanks for the issue, our team will look into it as soon as possible! If you would like to work on this issue, please wait for a maintainer to decide if it is ready to be worked on.

To claim an issue, please leave a comment that says ".take". If you have any questions, feel free to ping a maintainer.

@prjctimg
Copy link
Owner Author

.take

@prjctimg prjctimg self-assigned this Apr 17, 2024
prjctimg added a commit that referenced this issue May 9, 2024
…190)

all the smaller functions have been merged into one function which can be switched through
specifying the type of factor to use. not yet tested but looks stable enough for a commit

BREAKING CHANGE: The against and colorspace parameters are now specified as options. the function
takes a string or the factor as the first argument instead of a collection

feat #190
prjctimg added a commit that referenced this issue May 9, 2024
#190)

all sub functions are now accessible via specifying the factor to use as a filtering criteria

BREAKING CHANGE: this function takes a string as the first argument now and factor specific
parameters are now accessible as options on the second call which takes the collection

feat #190
prjctimg added a commit that referenced this issue May 9, 2024
* 📦 ci(formatter.yml): added workflow to lint and format code on push

* 📝 docs(readme.md): fixed attributions

* 📝 docs(navbar.njk): vavbar now changges flex direction on large screens

* 🧹 chore(docs): added more fields to the index.html file and added docsify plugins

* 🧹 chore(docs): modified the docs source files and assets

added favicons and progressive web app support. added docsify plugins. imporoved folder structure
and overall seo

* ✨ feat(sortby): refactored the module to have only one function (feat #190)

all the smaller functions have been merged into one function which can be switched through
specifying the type of factor to use. not yet tested but looks stable enough for a commit

BREAKING CHANGE: The against and colorspace parameters are now specified as options. the function
takes a string or the factor as the first argument instead of a collection

feat #190

* ✨ feat(filterby): merged all the sub functionas into one function (feat #190)

all sub functions are now accessible via specifying the factor to use as a filtering criteria

BREAKING CHANGE: this function takes a string as the first argument now and factor specific
parameters are now accessible as options on the second call which takes the collection

feat #190

* ✨ feat(stats): merged all stats functions into one function (feat #191)

all previous functions that returned the smallest/largest factor from collections and other similar
related functionality are now under one function that simply returns an object with all the stats in
a more compact way

BREAKING CHANGE: there's no more getFarthestHue or similar functions. all factors about a collection
asre now being returned at once instead of redundantly pilling up function calls you can just get
the data you need  from a single object

feat #191

* 📈 perf(helpers): improved collection detection during mapping (feat: #193)

feat: #193

* 🧹 chore(src): split all modules into single exports for easier debugging, testing and maintenance

* 🧹 chore(wrappers.js): fixed broken imports

* 🧹 chore: fixed broken imports,cleaned documentation file structure and updated files in configs

* 🧹 chore: fixed types output

* 📦 ci: readded build scripts to docs

* ✨ feat(achromatic.js): achromatic now checks if a color is gray by comparing rgb channel values

* ♻️ refactor(achromatic.js): created small helper for checking falsy cases on l and c channels

* 🧹 chore(alpha.js): proofread the documentation and removed the default parameter for color

* 🧹 chore(colors.js): updated the documentation

* ✨ feat(complimentary.js): removed the colorspace parameter. now uses jch by default

* 🧹 chore(lightness.js): refacored darken and brighten by extracting a base function

* 🧹 chore(deficiency.js): updated documentation and made the kind parameter case insensitive

* 🧹 chore(discover.js): updated the documentation

* 🧹 chore(earthtone.js): fixed the documentation

* 🧹 chore(family.js): fixed the documentation

* 🧹 chore(filterby.js): updated the documentation and made the factor parameter case insensitive

* 🧹 chore(get.js): updated the documentation

* 🧹 chore(hueshift.js): updated the documentation

* 🧹 chore(index.js): updated library exports

* ✨ feat: simplified all parameter signatures

All functions that can take an overrides or options object now take them as a single object.

* 🧹 chore(wrappers.js): fixed class methods by updating docs and related functions

* chore: release 3.0.0

release-as: 3.0.0

* 📦 ci(wiki-sync.yml): added workflow for synchronising wiki source docs with direct wiki edits

* 🐛 fix(src): removed incorrect incorrect invocation of token() which caused type rrors

* ✨ feat(achromatic.js): check for achromatic colors using the rgb colorspace

* 🧪 test(spec): refactored tests to match the new api

* 🧹 chore(mc.js): found missing else clause making the function return undefined

* 🧹 chore: simplified codebase and fixed a lot of bugs

* 📝 docs(achromatic.js): fixed documentation
@prjctimg
Copy link
Owner Author

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant