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

Optimize kinds.js module. Add tests #457

Closed
wants to merge 3 commits into from
Closed

Optimize kinds.js module. Add tests #457

wants to merge 3 commits into from

Conversation

rustworthy
Copy link

@rustworthy rustworthy commented Sep 16, 2023

  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md // N/A
  • update .d.ts typings // N/A

Changes:

  • return early if schema name OR (!) fields not specified when building projection;
  • check that 'root' passed to "projection" func respects Schema API;
  • add tests for "projection" func;
  • treat projection as a private case of 'kindMemory' and simplify 'getKindMetadata' dispatcher func;
  • use 'KIND_STORED_DEFAULT_META' and 'KIND_MEMORY_DEFAULT_META' constants to store module defaults;

As a side-note:
both 'schema' and 'fields' are words kind of reserved for Schema instance and field attribute of schema instance accordingly,
so I would suggest using schemaName and fieldNames where appropriate; not always this is clear from the context.

@rustworthy rustworthy changed the title Optimize projection func of kinds.js module. Add tests Optimize kinds.js module. Add tests Sep 20, 2023
@rustworthy rustworthy closed this by deleting the head repository Jul 2, 2024
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