json-fs-query 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/browser/jsonFsQuery.js +2 -2
- package/browser/jsonFsQuery.min.js +1 -1
- package/dist/data/utilities/parsers/findCommand.js +1 -1
- package/dist/data/utilities/parsers/findCommand.min.js +1 -1
- package/dist/data/utilities/parsers/findSortClauses.js +1 -1
- package/dist/data/utilities/parsers/findSortClauses.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,9 +64,9 @@ const [workouts, exercises] = await query("read workouts where date = '2024-06-0
|
|
|
64
64
|
|
|
65
65
|
The `;` after the last (or only) query is optional. A `;` inside a string, a comment or brackets doesn't end a query.
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
`
|
|
69
|
-
|
|
67
|
+
Keywords (`where`, `and`, `sort`, `limit`, `create`, `show records`...), command words (`read`, `insert`, `update`,
|
|
68
|
+
`delete`), sort directions (`asc`, `desc`) and comparators can be written in any case: `READ t` and `sort a ASC` work.
|
|
69
|
+
Record and field names are case-sensitive.
|
|
70
70
|
|
|
71
71
|
### Strings
|
|
72
72
|
|
|
@@ -369,6 +369,8 @@ queryStatus('read notes;') // { complete: true, waitingFor: ''
|
|
|
369
369
|
- A condition on a record that isn't in the query, or only links a join, is an error. Before, it matched nothing or
|
|
370
370
|
failed to read the record.
|
|
371
371
|
- Comparators are case-insensitive (`IN`, `LIKE`). Before, only lowercase ones matched anything.
|
|
372
|
+
- Command words and sort directions are case-insensitive (`READ t`, `sort a ASC`). Before, `READ t` was an
|
|
373
|
+
error and `sort a ASC` sorted descending.
|
|
372
374
|
|
|
373
375
|
## Configuration
|
|
374
376
|
|
package/browser/jsonFsQuery.js
CHANGED
|
@@ -2548,7 +2548,7 @@ const findCommand = (parsed, query) => {
|
|
|
2548
2548
|
parsed['command'] = undefined;
|
|
2549
2549
|
parsed['entity'] = undefined;
|
|
2550
2550
|
if (commandFound) {
|
|
2551
|
-
parsed['command'] = commandFound[1];
|
|
2551
|
+
parsed['command'] = commandFound[1].toLowerCase();
|
|
2552
2552
|
parsed['entity'] = commandFound[2];
|
|
2553
2553
|
return (0, _removeFromQuery.removeFromQuery)(commandFound[0], query);
|
|
2554
2554
|
}
|
|
@@ -2983,7 +2983,7 @@ const findSortClauses = (parsed, query) => {
|
|
|
2983
2983
|
for (const sortClause of sortRulesFound) {
|
|
2984
2984
|
parsed['sortClauses'].push({
|
|
2985
2985
|
property: sortClause[2],
|
|
2986
|
-
direction: sortClause[3] || 'asc'
|
|
2986
|
+
direction: (sortClause[3] || 'asc').toLowerCase()
|
|
2987
2987
|
});
|
|
2988
2988
|
}
|
|
2989
2989
|
return (0, _removeFromQuery.removeFromQuery)(sortFound[0], query);
|