Shared utilities for the restQuery library that enables performing REST queries directly on your database. Version 0.35.1 targets Node.js >=16.13.0 and browsers. Works alongside rest-query-node and rest-query-browser to provide a unified REST-like query interface. The shared package handles query parsing, validation, and type definitions for both environments. No major competitors for this specific approach; key differentiator is direct database queries via REST.
npm install rest-query-sharedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a REST query string and validates the resulting structure. Demonstrates basic usage of parseQuery and validateQuery.
Update calls to parseQuery(options, query) instead of parseQuery(query, options).
Use validateQuery only for structural checks; schema validation must be done server-side.
Install a rest-query adapter like rest-query-mongodb or rest-query-postgres.
Upgrade Node.js to >=16.13.0 or enable --experimental-modules (not recommended).
Remove any resource validation logic in client code; rely on the backend adapter.
Adjust any code that relied on the 'type' property; use typeof or custom type checking.
Ensure query strings follow the supported operator syntax: '=', '!=', '<', '<=', '>', '>=', 'like', 'in'.
Use named imports: import { parseQuery } from 'rest-query-shared'.Use dynamic import: const restQueryShared = await import('rest-query-shared').Check the list of supported operators and use '>=', '<=', etc.
No dependency data recorded yet.