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/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 {{preventEval?: boolean}} [options]
364
+ * @param {{eval?: boolean}} [options]
363
365
  * @returns {Promise<unknown>}
364
366
  */
365
- export async function resolveIndexedDBQuery (parsed, {preventEval} = {}) {
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 /** @type {(config: object) => unknown} */ (jsonpath)({
374
+ return jsonpath({
373
375
  path: '$' + trailing,
374
376
  json: data,
375
- preventEval,
377
+ eval: evalMode,
376
378
  wrap: false,
377
- returnType: 'value'
379
+ resultType: 'value',
380
+ customTypes: structuredCloningTypes
378
381
  });
379
382
  }
380
383