Skip to content

Jules wip 17878915225293939315 #25

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

duereg
Copy link
Owner

@duereg duereg commented May 22, 2025

No description provided.

This commit brings the project's dependencies up to date and modernizes the JavaScript development environment.

Key changes include:
- Updated Node.js engine requirement in `package.json` to `>=20`.
- Updated all npm dependencies to their latest compatible versions.
- Updated ESLint configuration (`.eslintrc`) to use `ecmaVersion: 2022` for better support of modern JavaScript syntax.
- Applied auto-fixable linting rules.
- Refactored `lib/algorithms/1-strings/compress.js` to use modern JavaScript syntax and improve clarity. `lib/dataStructures/stack.js` was reviewed and confirmed to be already modern.

All linters and tests pass, ensuring the codebase remains healthy and functional after these updates.
This commit introduces improvements to the Trie data structure's value handling and significantly expands its test coverage.

Key changes:
- Modified `Trie.getValue()` method in `lib/dataStructures/trie.js` to correctly return `undefined` if a word does not exist or if the queried string is only a prefix of an existing word. It now only returns a value if the exact word is found.
- Added new test suites to `spec/dataStructures/trie.getValue.spec.js` to cover:
    - Retrieving values for non-existent words (including prefixes and words longer than existing entries).
    - Storing and retrieving various data types (strings, numbers, objects, arrays, empty strings) as custom values.
    - Ensured test data aligns with `Trie.add()` method's validation (avoiding `null` values which are disallowed).
- Fixed a `max-len` linting error in the new test file.

All tests (255 specs) and linters now pass, ensuring the Trie's functionality is robust and well-verified.
… done so far and provide feedback for Jules to continue.
This commit introduces five new utility algorithms you requested,
focusing on text, data, and geospatial processing, with low existing
coverage in the open-source community.

Algorithms Added:

1.  Aho-Corasick with Fuzzy Matching:
    - Location: lib/algorithms/1-strings/ahoCorasickFuzzy.js
    - Description: Efficiently searches for multiple keywords in text,
      with support for fuzzy matching (Levenshtein distance).
    - Tests: spec/algo/1-strings/ahoCorasickFuzzy.spec.js

2.  HyperLogLog++:
    - Location: lib/dataStructures/hyperloglog-plus-plus.js
    - Description: A probabilistic data structure for estimating the
      cardinality of large datasets with high accuracy and low memory usage.
      Includes bias correction.
    - Tests: spec/dataStructures/hyperloglog-plus-plus.spec.js

3.  Cuckoo Filter:
    - Location: lib/dataStructures/cuckoo-filter.js
    - Description: A probabilistic data structure for approximate set
      membership testing that supports additions and deletions.
    - Tests: spec/dataStructures/cuckoo-filter.spec.js

4.  Distributed Fixed Window Rate Limiter:
    - Location: lib/algorithms/networking/distributed-fixed-window-rate-limiter.js
    - Description: Implements fixed window rate limiting logic adaptable
      for distributed systems (e.g., using Redis). Includes an in-memory
      store adapter for standalone use/testing.
    - Tests: spec/algo/networking/distributed-fixed-window-rate-limiter.spec.js

5.  Concave Hull (k-Nearest Neighbors based):
    - Location: lib/algorithms/geospatial/concave-hull-knn.js
    - Description: Generates a non-convex polygon representing the shape
      of a 2D point set, using a k-NN approach.
    - Tests: spec/algo/geospatial/concave-hull-knn.spec.js

All implementations include JSDoc documentation and error handling.
The README.md has been updated with descriptions and usage examples for
each new algorithm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant