jtlt 0.24.2 → 0.25.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/.github/workflows/test.yml +17 -0
- package/CHANGES.md +10 -1
- package/demo/codemirror.esm.js +1 -1
- package/demo/vendor/jsonpath-plus/dist/index-browser-esm.js +1165 -597
- package/dist/JSONPathTransformerContext.d.ts +5 -5
- package/dist/JSONPathTransformerContext.d.ts.map +1 -1
- package/dist/XPathTransformerContext.d.ts +3 -3
- package/dist/XPathTransformerContext.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/indexedDB.d.ts +3 -3
- package/dist/indexedDB.d.ts.map +1 -1
- package/docs/API.expanded.md +1 -1
- package/package.json +15 -15
- package/pnpm-workspace.yaml +32 -29
- package/src/JSONPathTransformerContext.js +39 -25
- package/src/XPathTransformerContext.js +1 -1
- package/src/index.js +1 -1
- package/src/indexedDB.js +8 -5
package/src/indexedDB.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {JSONPath as jsonpath} from 'jsonpath-plus';
|
|
2
|
+
import structuredCloningTypes from
|
|
3
|
+
'jsonpath-plus/src/structuredCloningTypes.js';
|
|
2
4
|
import fontoxpath from 'fontoxpath';
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -359,22 +361,23 @@ export function parseIndexedDBExpression (expr) {
|
|
|
359
361
|
* trailing JSONPath segment is present (e.g. `.*.name`), evaluate it against
|
|
360
362
|
* the fetched records. Shared by the JSONPath and XPath engines.
|
|
361
363
|
* @param {ParsedIndexedDBExpression} parsed
|
|
362
|
-
* @param {{
|
|
364
|
+
* @param {{eval?: boolean}} [options]
|
|
363
365
|
* @returns {Promise<unknown>}
|
|
364
366
|
*/
|
|
365
|
-
export async function resolveIndexedDBQuery (parsed, {
|
|
367
|
+
export async function resolveIndexedDBQuery (parsed, {eval: evalMode} = {}) {
|
|
366
368
|
const {dbName, storeName, options, trailing} = parsed;
|
|
367
369
|
const data = await queryIndexedDB(dbName, storeName, options);
|
|
368
370
|
if (!trailing) {
|
|
369
371
|
return data;
|
|
370
372
|
}
|
|
371
373
|
// A JSONPath trailing segment always begins with a step (`.` or `[`).
|
|
372
|
-
return
|
|
374
|
+
return jsonpath({
|
|
373
375
|
path: '$' + trailing,
|
|
374
376
|
json: data,
|
|
375
|
-
|
|
377
|
+
eval: evalMode,
|
|
376
378
|
wrap: false,
|
|
377
|
-
|
|
379
|
+
resultType: 'value',
|
|
380
|
+
customTypes: structuredCloningTypes
|
|
378
381
|
});
|
|
379
382
|
}
|
|
380
383
|
|