Skip to content

Conversation

@duereg
Copy link
Owner

@duereg duereg commented May 22, 2025

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 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.
@duereg duereg merged commit 2dae358 into master May 22, 2025
2 checks passed
@duereg duereg deleted the feat/modernize-js-deps branch May 22, 2025 23:15
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.

2 participants